[AccessD] Record count

Darren Dick D.Dick at uws.edu.au
Wed May 25 18:10:15 CDT 2005


Hi Jim Et al

>>>What is the easiest way in code to determine if a table has at least
one record? TIA

Assuming you want to do this in code...

If it's a one off search type of situation, similar to
Seeing if a person exists in a dB - I use Dlookup or DCount 

If it's in a loop of a recordset I steer clear of Dlookup or DCount -
just use .EOF or BOF
Or even .MoveLast .MoveFirst to 'build' or populate the recordset

You'll have to Trap err.number 3021 if there are no records.

Hope this helps

DD



More information about the AccessD mailing list