No data in a table

J

jeanulrich00

Hi

I have a button on a form. There is no record source

When the user click on the button, it runs a query.

What I want to do is : when the user click on the button, if there is
no records in the table "T-Data", code will stop and if there is some
records, code will continue.

just the code to look if there is some records, will be great for me.
I have try with count function without success

thanks for helping
 
P

Pat Hartman

You can use the DCount() to determine the count of records in a table:

If DCount("*", "your table name") >0 Then
' continue code goes here
Else
' stop process code goes here
End if
 
Top