View Single Post
  #5  
Old May 26th, 2010, 01:17 PM posted to microsoft.public.access.queries
poorboy13 via AccessMonster.com
external usenet poster
 
Posts: 3
Default Descision based on a query

The If IsNull did the trick! Thank you Thank you
I appreciate your willingness to share your knowledge!!

Thanks again,
Scott Pawling

Marshall Barton wrote:
If the query does not return any records then the DLookup
will faill to find anything so the result will be Null
making the If statement fail. If someone is checking in,
there won't be a record yet, right? On this case you should
check for Null:
If IsNull(DLookup("Present", "qry_GetWork")) Then

Are you sure the Present field in its table is a Yes/No
field? If it is, double check the value of the field is
either 0 or -1 (eg. SQL Server uses 0 and +1 instead of
Access's 0 and -1).

If none of that helps, try my earlier suggestion skip the
the query and have DLookup go directly to the table.

I appreciate the response - However, I have tried every which way I can think
of to write it and I'm not coming up with a correct answer.

[quoted text clipped - 29 lines]
If DLookup("Present", "Attendance", "EmpID=" & something _
& " And datefield= Date()") = 0 Then



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1