query with no results

Jackske

Registered User.
Local time
Today, 13:00
Joined
Feb 28, 2000
Messages
48
I have a form based on a query.
I want – before the form appears on the screen – to check if the query is empty or not.

Via which Event can I do this and what is the code.

Thanks,

Jackske/Belgium
 
try the following on the OnOpen of the Form

Code:
If DCount("*", "Queryname") = 0 Then
MsgBox "Empty box"
DoCmd.Close acForm, "formname"
End If
 
Also if you remove the msgbox, simply nothing happens !
 
thanks but it did not work.
I had to create first a table and after this, to check if the table is empty.

Never less, thanks


Jackske/Belgium
 
i have tested it on a form based on a query myself and it worked fine for me! did you get any error message ?
 

Users who are viewing this thread

Back
Top Bottom