Problems with validating forms

Joined
Jul 1, 2006
Messages
2
Reaction score
0
[font=Verdana, Arial, Helvetica][font=Verdana, Arial, Helvetica] I am new to the VBA world. I have a form that I am trying to validate the fields on. They are either text boxes or combo boxes. I have a custom function that is called when the user clicks a command button. I cannot test any of these fields for no user input or null. None of these work:

If (Me.txtProductCode = Null) Then
' some code here
End if

or

If Len (Me.txtProductCode) = Null Then
' some code here
End if
or

If Len(Me.txtProductCode) = 0 Then
' some code here
End if

If IsNull(Me.txtProductCode) = True Then
' some code here
End if

I have tried to use the expression builder but it is very confusing for me. I'd rather do this in VB code. So, how do you check the contents of form fields in VB? Where is there some very good examples of this? Thanks

(e-mail address removed)
[/font][/font]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top