Skip Function if Table is Empty

brucesilvers

Registered User.
Local time
Today, 13:36
Joined
Aug 4, 2000
Messages
70
I'd like to create an If..Then statement that exits the current function if a certain table contains no data. How do I specify the table and field and how should I word the Is Null part of the statement? THANKS!
 
Your request is a bit confusing... If the table is in fact empty of records then this will work:

If DCount("*", "TableName"]<1 Then Exit Sub

If you want to find if a field in a record is Null then this should work:

If IsNull("[FieldName]","TableName","[UniqueID] =" & Me![FormFieldWithUniqueID]) Then
Exit Sub
End if



[This message has been edited by Jack Cowley (edited 10-13-2000).]
 
I used the DCount code and it works great. Can the same thing be done with queries? If so, is there a different way to refer to the query name?

Thanks again!!!
 
Just put the query name in where the table name is. It will work the same.....
 

Users who are viewing this thread

Back
Top Bottom