Close form without entering criteria

J

jojo

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!
 
O

Ofer

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
 
J

jojo

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.
 
J

jojo

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.
 
Top