mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Tue Apr 06, 2010 12:57 pm Post subject: Close form when no data |
|
|
When the underleing quesry returns no data and you don't want to display a blank form use this code:
Code: | Then, in the On Open event try code like this:
If DCount("[keyfield]","queryname") = 0 Then
MsgBox "No data returned!"
DoCmd.Close acform, "formname"
End If
|
This will close the form if the query returns no data. |
|