Close form without entering criteria

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

Guest

I have a form which prompts the user to enter criteria to generate a report
(which is based off a query). If I close the form without entering any
criteria a box appears to "Enter Parameter Value". If I decide I don't want
to generate the report, how can I close/exit the form without having that
message appear.
Thanks!
 
Can you post your code?

If you use Input box to get the value from the user, then you can use this
Dim Param as String
Param = InputBox("Please enter a parameter for the report")
If param <> "" then
Docmd.OpenReport "Report Name"
End If
 
I am not using an input box to get the value. I followed the instructions in
'MS Access Help' to Use a form to enter report criteria.
However, when I click on my Cancel command button, a box appears to "Enter
Parameter Value", and then I have to click on Cancel again from that box. I
just want to be able to click on Cancel once.
 
I am not using code. I've created macro's for my OK and Cancel buttons (On
click events) by following the steps in 'MS Access Help' on how to Use a form
to enter report criteria. My report generates fine when clicking on the OK
command, it's just my cancel button prompts a parameter value before closing.
Thanks.
 
Back
Top