Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Table is Empty....

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
Hi,

I'm trying to check if a table is empty in my access app.

Here's what I have:

If "TableName = 0 Then
MsgBox "No Parts where found."
GoTo theend
Else
End If

I'm having trouble with the correct syntax to look for the table ("TableName").

I would appreciate any help!

Thank you!
 
Provided the table is local (ie not linked):
If CurrentDb.TableDefs("Table1").RecordCount = 0 Then

Otherwise you may consider a domain aggregate function like DCount or DLookUp

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top