J Jackske Registered User. Local time Tomorrow, 01:22 Joined Feb 28, 2000 Messages 48 Jul 20, 2004 #1 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
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
maxmangion AWF VIP Local time Today, 23:22 Joined Feb 26, 2003 Messages 2,805 Jul 20, 2004 #2 try the following on the OnOpen of the Form Code: If DCount("*", "Queryname") = 0 Then MsgBox "Empty box" DoCmd.Close acForm, "formname" End If
try the following on the OnOpen of the Form Code: If DCount("*", "Queryname") = 0 Then MsgBox "Empty box" DoCmd.Close acForm, "formname" End If
maxmangion AWF VIP Local time Today, 23:22 Joined Feb 26, 2003 Messages 2,805 Jul 20, 2004 #3 Also if you remove the msgbox, simply nothing happens !
J Jackske Registered User. Local time Tomorrow, 01:22 Joined Feb 28, 2000 Messages 48 Jul 20, 2004 #4 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
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
maxmangion AWF VIP Local time Today, 23:22 Joined Feb 26, 2003 Messages 2,805 Jul 20, 2004 #5 i have tested it on a form based on a query myself and it worked fine for me! did you get any error message ?
i have tested it on a form based on a query myself and it worked fine for me! did you get any error message ?
R Rich Guest Jul 20, 2004 #6 Or http://www.access-programmers.co.uk/forums/showthread.php?t=62548&highlight=recordsetclone