No data in a table

  • Thread starter Thread starter jeanulrich00
  • Start date Start date
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
 
Jean,
Upon clicking the button code this first...
If Isnull(DCount("*","tblYourTable") Then
'error MsgBox No Records...
Else
'Run the Query
End if

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top