• All
  • Free Web Hosting
  • Category 2
gravatar

How to trim textboxes in VB6?

 As part of the data validation, trimming of text space with in a textbox is very important.

Here is the Code:

If Trim(txtAccCode.Text) = "" Then
        MsgBox "Account Code is Required!", vbCritical, "MCRP - Access Level: Save Error"
        txtAccCode.SetFocus
        txtAccCode.BackColor = vbYellow
        Exit Sub
    End If