Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for Null Values

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US

I have a form where the user enters various fields of information. Some of these fields may be left blank until a point in time when the user is ready to issue a permit. At that time they will click a button that unleashes a sequence of events that ultimately results in the aforemntioned permit being issued. The first events is a data checking routine, to make sure that all the values are appropriate for this action. I'm able to test most things quite easily. However when a field is null and I use the following syntax:

If Me![OwnerNo] Is Null Then
MsgBox "You must enter a valid Sign Owner before issueing a permit."
Exit Sub
End If

It reurns the message "Object Required", while the following command works fine:
If Me![NewStatus] = "I" Then
MsgBox "You must change the status to something other than 'Illegal' before issueing a permit."
Exit Sub
End If

What gives?

Also, Is it not possible to assign background colors to tab pages?

Thanks!
 
Either:
If IsNull(Me![OwnerNo]) Then

Or:
If Trim(Me![OwnerNo] & "") = "" Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top