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!

Null criteria in Access 2007 1

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
US
I have a form that looks for whether a job is active or not...some people type in "y", "N" or nothing at all. I need a message to pop up if the job is "N" or blank. My code runs fine with "Y", "N" but does not work for blank entries....this is my code, can someone please tell me what to put in to find the null values. I have tried, " ", isnull and null.

Dim varactive As Variant

varactive = DLookup("[Active Job]", "tbl Subcontractor Schedule", ("[jobno] = [Combo5]"))
If varactive = " " Or varactive = "N" Then
MsgBox "This is not an Active Job"
Else
End If


thank you,
Micki
 
if trim(varActive & " ") = "" or varActive = "N"

accounts for both null, "" or "
 
Thanks all both of you, I forgot to let you know that I tried MAJP's code and it worked fine.

Micki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top