Results 1 to 2 of 2
  1. #1
    jachbow is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    4

    OpenQuery Parameters?

    Click image for larger version. 
<br /><script async src=
    Name: Picture1.png  Views: 11  Size: 52.7 KB  ID: 46313" class="thumbnail" style="float:CONFIG" />
    Hello,

    I am wanting to have an OpenQuery Macro in one of my forms that automatically inputs the content of the field as the parameter to the query. As of right now, I have an OnDblClick event embedded in the column I want but the query does not automatically run. Upon further research, I think a solution may be to edit parameters in the macro itself but I can't seem to find where to do this; any ideas? Attached is a simplified example of the form's current state. After I double click on a letter the prompt opens to run a query. I am wanting the query to run with the letter automatically inputted as the constraint.


    Thank you

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,669
    I don't use macros but suspect that your query should use the form field as criteria and not a parameter prompt. Something along the lines of

    ...WHERE myField = Forms!Example.Col_1...

    I would have thought that you should be filtering on the ID field, not Col_1.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. AfterUpdate OpenQuery/UpdateQuery from a combo box
    By stephenvought in forum Access
    Replies: 2
    Last Post: 11-15-2018, 06:26 PM
  2. Openquery asks twice
    By damiancds in forum Queries
    Replies: 3
    Last Post: 08-06-2016, 03:55 AM
  3. DoCmd.OpenQuery really necessary?
    By Bleekscheetje in forum Programming
    Replies: 3
    Last Post: 09-05-2015, 08:44 AM
  4. DoCmd.OpenQuery with Parameters?
    By mwhcrew in forum Queries
    Replies: 5
    Last Post: 10-10-2014, 01:49 AM
  5. OpenQuery and Requery
    By Daryl2106 in forum Access
    Replies: 8
    Last Post: 11-24-2011, 08:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums