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. 

Name:	Picture1.png 
Views:	12 
Size:	52.7 KB 
ID:	46313Hello,



    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 offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    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.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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