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 Rhinorhino 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
Joined
Jul 20, 2004
Messages
337
Location
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 "
 
if len(Trim(varActive)) = 0

OR

if not varActive = "Y" then

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
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