when I close a form of a report the blank report opens

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

Guest

i am a beginner. so please excuse me for my ignorance...

I have created a query which gets its parameters from a form. Now I have
created a report based on this query. When I open the report, the form
appears as reqd. But when i just close the form without entering the
parameter values, the report prompts for the parameter values and a blank
report opens.....

How can I avoid this???

Thanx in advance
 
You can put code in the Onopen event of the report to check if the form is
open, and if it's not, prompt the use with a message and close the report

If Not CurrentProject.AllForms("FormName").IsLoaded Then
MsgBox "FormName is not open"
Cancel = True ' Close the report
End If
 
Back
Top