Re-post: Cancel parameter query

A

Ashley

I have a parameter query in the Criteria [Type in your
value]. It prompt user to enter the criteria.
If the user decided to Cancel the action by click on the
Cancel button, I want it to go back to a form call
switchboard. This is a pop-up that created by the
parameter query.
Can someone help me with this?

Thanks
 
R

Rick B

Unless that was the form up before they ran the query, I don't think you can
do it.

You can't apply code to ta query, so you can't specify an action to take if
the query is cancelled by the user.

Rick B


I have a parameter query in the Criteria [Type in your
value]. It prompt user to enter the criteria.
If the user decided to Cancel the action by click on the
Cancel button, I want it to go back to a form call
switchboard. This is a pop-up that created by the
parameter query.
Can someone help me with this?

Thanks
 
A

Ashley

I have a query pull record from a table with a parameter.
I want the record with specified parameter to show up in a
form.
Ashley
 
V

Van T. Dinh

Create a Form frmParameter with a TextBox txtParameter and
2 CommandButtons: cmdOpenForm and cmdCancel. Use the full
reference to the TextBox txtParameter as the Parameter in
your Query being used as the RecordSource for
frmYourRealForm.

When the user wants to open frmYourRealForm, your code
opens the frmParameter first so that the user can enter
the Parameter value and then click the cmdOpenForm to open
frmYourRealForm (your code should close the frmParameter
after the opening of frmYourRealForm). The Query will
pick up the Parameter value from frmParameter.

If the user clicks cmdCancel, simply close frmParameter
and re-open the frmSwitchboard.

HTH
Van T. Dinh
MVP (Access)
 

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

Top