avoid loading an empty form

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

Guest

How can I avoid loading a form when the source table is empty?

Thank you for you help!
 
The best place is in the form's Load event:

If Me.Recordset.RecordCount = 0 Then
MsgBox "No Records To Process"
DoCmd.Close
End If
 
Or, if you go into VB and search help for "open", it will tell you how to
cancel the open event. - This may be a few milliseconds quicker than closing
it after laod.
 
I don't think so. Open has nothing to do with forms. There is no way to
cancel an OpenForm action or method.
 

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