Query won’t access open form field for parameter

5 pts.
Tags:
Database programming
WHERE statement
I want to open a group of receipt forms using the "client ID" from the open form "Client" as the parameter. I created a button which runs the "openform" action macro using "[Client ID]=[Forms]![Client]![ID]" as the Where Condition. This was working until I closed the access program and reopened the next morning. When the macro was run a parameter box opened asking for the parameter [Forms]![Client]![ID]. I found when I deleted the "Client ID" field from thte form and then replaced it from the add existing field list everything worked fine again. Until I closed the program and the probllem was back when I reopened access. I would really appreciate some ideas help as I can't think of anything else to try .

Answer Wiki

Thanks. We'll let you know when a new response is added.

Most likely what’s happening is you ran the macro with the form closed. The form has to be open for access to read Forms!Client!ID. If the macro runs with the form closed it will prompt you for the parameter. To make sure the form is always open when the macro is run you may to put a Docmd openform at the beginning.

If that wasn’t the case then access is acting funky and you may have to try a different way to filter the data. (Build a query with [Forms]![Client]![ID} in the equals part and link your receipts forms to the query instead of to the Clients table)

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following