View Full Version : quick If isnull & DCount line


swarv
02-24-2009, 12:31 AM
I have the following line:

If IsNull(DCount("*", "qry_checkallusersforticks")) And username1 = "Janine" Then

Can you tell me if this is likely to work?

The program does process the line but always goes staight to the Else commands.

The query it refers to is:

SELECT absent.id, absent.Name, absent.Days, absent.notes, absent.comments, absent.backtowork, absent.certification, absent.start_date, absent.end_date
FROM absent
WHERE absent.backtowork = "No" OR absent.certification = "No";

Bascially I want it to load a form if any of the records in the absent table have a 'no' against them.

Thanks

DCrake
02-24-2009, 04:20 AM
Try

If nz(DCount("*", "qry_checkallusersforticks"),0) = 0 And username1 = "Janine" Then


David

swarv
02-24-2009, 04:32 AM
excellent, thanks. your a star