Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    65

    Unanswered: Anyone know why access sometimes prompts for a variable twice?

    Hi all,

    about 50% of the time when writing queries with variables i have this problem whereby it prompts you for a variable value twice when the query is run.

    anyone know why it does this and why the exact same query in a different mdb only prompts once?

    greg

  2. #2
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    what do you mean prompts for the variable twice? where exactly is this code at? if it is on a form check to see if it is firing under multiple events. if you are prompted from a query, are you using multiple queries each of which prompts for a value?

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    There's a lot of causes, but only one reason: Access comes across the variable twice while processing the query, therefore, prompts for it twice.

    tc

  4. #4
    Join Date
    Dec 2003
    Posts
    138
    I've run into this problem at various times with a date field and finally discovered simply recreating the query has been more successful than trying to fix it.

    D

  5. #5
    Join Date
    May 2006
    Posts
    65
    Hi all,

    no the query only has one instance of the variable and no other queries feeding it re

  6. #6
    Join Date
    May 2006
    Posts
    65
    Hi all,

    no the query only has one instance of the variable and no other queries feeding it require a variable.

    think there is a bug as it worked fin when i rebuilt the qury on dendalee's advice..

    guess it's just an anomly. although it's happenend before...

    greg

  7. #7
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I have read somewhere in MSDN that Access will create multiple queries (hidden) to support a more complicated query when it has to, and that sometimes it will even when the query is not that complicated.

    This is generally not an issue, unless things are so big that you start hitting the various ceilings in Access.

    If the recreation was identical to the original, than it probably was an anomoly.

    tc

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what are you using the query in, ie what are you atually trying to do whn you see this problem. is it in a recordset, a query, a form?

    what is the query you are hitting this problem with?

    One of the joys of working with a db is that you issue the SQL command to the SQL parser, but you don't actually know (or even want to know) is how the SQL parser actaully handles the request. Its possible that the JET parser may "just" decide to use a differnet query plan dependant on what columns are indexed or criteria are applied.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •