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

isnull is not working

Status
Not open for further replies.

DBAchick

Programmer
Apr 27, 2000
61
I am trying to find a record in one recordset where the group name matches a record in another recordset but a field in that second recordset's record is null.<br><br>Here is my line of code:<br><br>If Exists_rs![RLGroupName] = Snap_rs![RLGroupName] AND IsNull(Exists_rs![RLString2] then Answer = &quot;Yes&quot;<br><br>This line of code is within a loop.&nbsp;&nbsp;The first time through Answer should be Yes because Exists_rs![RLString2] is null.&nbsp;&nbsp;However, the second time through, RLString2 is NOT null (value = &quot;North&quot;) and Answer is still being set to &quot;Yes&quot;.<br><br>What am I missing?&nbsp;&nbsp;I have a flat spot on my head from banding it against my cubicle wall!!!
 
You are missing a Parenthesis at the end of your ISNULL<br><br>If Exists_rs![RLGroupName] = Snap_rs![RLGroupName] And IsNull(Exists_rs![RLString2] &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; XXXXXXXXX <br>Try this<br>If Exists_rs![RLGroupName] = Snap_rs![RLGroupName] And IsNull(Exists_rs![RLString2]) Then Answer = &quot;Yes&quot;<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
In my REAL code I have that paren...I just missed it when I retyped into this forum.<br><br>Any other ideas?
 
Nevermind..<br><br>I figured out the problem.&nbsp;&nbsp;The variable Answer was always set to Yes.&nbsp;&nbsp;I had to reinitialize it each time I loop through...<br><br>Thank you anyway.
 
Why are you re-typing it have'nt you heard of Copy and Paste. Even if the PC you submit to does not have Internet it has a floppy. Paste your code in notepad. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top