If a query has no results, can I hide or close it.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If a forms underlying query has no results, can I close the form
automatically. How?
 
Yep this will do it :

Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.EOF Then
DoCmd.Close acForm, Me.Name
End If
End Sub

- Raoul
 
Thank you so much Raoul. It worked perfectly!

JaRa said:
Yep this will do it :

Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.EOF Then
DoCmd.Close acForm, Me.Name
End If
End Sub

- Raoul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top