Open Form if Has Data

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

Guest

I am trying to figure out how to open a form ONLY if it has data. I am using
a macro to open the form. I've tried using a condition, but it won't
recognize the condition. It says the field doesn't exist. (Probably because
there is no data!)

Please help!

Thank you.
 
On the form load event you can write the code, to check if the form has any
records, if not the form will be closed

If Me.RecordsetClone.RecordCount = 0 Then
DoCmd.Close acForm, "FormName"
End If
 

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