Results 1 to 4 of 4
  1. #1
    damiancds is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016

    Openquery asks twice

    So, long story short: We use a database at my job, and i'm working on it to add improvements, and I'm still learning the ropes. So I've drilled down - there's a form button that runs a macro that opens a query, and whenever i click on the button (or even go to my list of queries and open it that way (to cut out the middle man so-to-speak) it will ask me to enter a parameter value twice. the actual call from the macro: OpenQuery (Query Name, Datasheet, Edit) the first time the input goes nowhere and only the second time it actually "takes the info" how can I go about making this not happen? where should i look and what for? thanks,

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Ontario, Canada
    Open the query in design and look for criteria in the criteria row that is surrounded by square brackets [ ]. If the prompts are for the exact same parameter, expect to find two query fields asking for the same thing, otherwise there is likely a second parameter in another (OR) criteria line for just one field. If you don't see anything like this, right click on the area showing the tables and choose Parameters... from the list. They could be defined there. This would also be evident in the sql view of the query - the sql would start with the word Parameters.

    How you'd stop this depends on what can be done to supply the information without user interaction. Often, parameters are used to get info from the user, such as a begin and end dates for a query. More information on what is being asked for and perhaps where it might come from would be required.
    Last edited by Micron; 07-30-2016 at 09:01 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    damiancds is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Well, I followed the advice, and there was two criteria. I deleted one and it got rid of the double prompt, but it gave me data fromm a while month instead of just the current day. So I put the criteria back in and now I have just the current day, and the double prompt is gone. Not sure what happened but it worked


  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    probably a typo difference between the two prompts (perhaps a superfluous space)

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

Similar Threads

  1. DoCmd.OpenQuery really necessary?
    By Bleekscheetje in forum Programming
    Replies: 3
    Last Post: 09-05-2015, 08:44 AM
  2. DoCmd.OpenQuery with Parameters?
    By mwhcrew in forum Queries
    Replies: 5
    Last Post: 10-10-2014, 01:49 AM
  3. docmd.OpenQuery produces error 2001
    By ultimateguy in forum Programming
    Replies: 4
    Last Post: 08-09-2014, 10:16 PM
  4. OpenQuery and Requery
    By Daryl2106 in forum Access
    Replies: 8
    Last Post: 11-24-2011, 08:40 AM
  5. Qry that asks for specific employee name
    By oxicottin in forum Queries
    Replies: 0
    Last Post: 02-05-2007, 08:50 PM

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