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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see if table has data in it

Status
Not open for further replies.

jaybird19

Programmer
Jan 16, 2009
7
US
How can I check to see if a table has data? Based on whether or not tbl_Codes has any data in it, I want to run one of two macros. I need a boolean or similar function to let me know if tbl_Codes has data in it or not. I know how to set the macro after that.

Thanks for your help!
 
Code:
If DCount ("*", "tbl_Codes") > 0 Then
  Msgbox "Table has data"
Else
  Msgbox "Table doesn't have data"
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top