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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with "NULL" 1

Status
Not open for further replies.

TeddB

MIS
Jul 16, 2001
38
US
I have the following code:
strVar1 = Forms![frmQry_CaseSummary]![DevlName].Value

If strVar1 = Null Then
..you know the rest...

Debug shows that strVar1 = NULL, however the IF statement does not execute!

What am I not seeing here???

"A good man knows his limitations." -- "Dirty Harry" Callahan (Clint Eastwood)
 
Try this instead:

If IsNull(strVar1) Then

If that doesn't work, try

If strVar1 = "" Then


 
Hi!

You can also try:

if(strVar1 <> &quot;&quot;)then
....
else
....
end if

M.
 
I tried &quot;If IsNull(strVar1)&quot; and it worked just fine.

Thank you, ReluctantDataGuy.



&quot;A good man knows his limitations.&quot; -- &quot;Dirty Harry&quot; Callahan (Clint Eastwood)
 
Also look in the help for the
Code:
Nz
function. It is specially made for variant-to-string conversions.

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top