Results 1 to 10 of 10
  1. #1
    BrendaP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    4

    Parameters in queries


    I have a report that has two sub reports. The sub reports are based on two different queries that have a parameter in each. When I run the report it prompts me to enter the two parameters for each record (there could be 30 or more records), how do I get the parameters to only ask me once and pull all records? My parameter is >[Continued ED Starting After XX/XX/XXXX] and the other parameter is >[Credits Starting After Date: XX/XX/XXXX], so I would like to just enter this information once and return all records with that criteria and not have to enter the information 30 or more times to get all records.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You mean parameter, not perimeter - I edited your post.

    I NEVER use dynamic parameterized queries. However, might be needed in this case. I absolutely would not use popups in query. Have query reference an input control on a form as the parameter.

    Regardless, the prompt should not trigger 30 or more times - only once for each subform.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    BrendaP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    4
    Sorry about that, I am new to access and i'm not sure what you mean to "have query reference an input control on a form as the parameter" Could you explain this for me? Thanks for your help.

  4. #4
    RayMilhon is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    If you have a report with 2 sub reports depending on where the sub reports are in the main report the sub reports could fire multiple times the parameter in the query will prompt you each time. If you create a form in your DB and put the parameter in a textbox and enter the parameter in the textbox Then where the parameter is in your Query reference the textbox instead Forms!myform!textbox Then you won't be prompted for the parameter the query will look it up from the form.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Build a form for user to input/select filter criteria with UNBOUND controls (textbox, combobox, listbox).

    Instead of >[Continued ED Starting After XX/XX/XXXX] use >Forms!formname!controlname.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  7. #7
    BrendaP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    4
    OK I created another form and placed an unbound text box on it with the parameter in the control source and it does nothing except it says error. What is the form supposed to be linked to and how do I get the text box to prompt for an answer, I am sorry but I am confused as to how to set this up.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Did you look at the link and tutorials/examples I suggested?

    Please show us some of your code and error messages etc.

  9. #9
    BrendaP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    4
    I did look through that website I am just unsure as to how to set up the form. If I put the code in the text box and then click view it just says #Name? and should the form be link to a query or a table?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The form just has UNBOUND control for user input of a value.

    Query references the control as described in post 5.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 9
    Last Post: 08-27-2014, 11:34 AM
  2. Replies: 6
    Last Post: 11-13-2013, 04:17 PM
  3. Replies: 7
    Last Post: 04-29-2012, 02:06 PM
  4. Value from 2 queries
    By kwooten in forum Reports
    Replies: 1
    Last Post: 10-19-2011, 01:23 PM
  5. Queries
    By MeganDoak in forum Queries
    Replies: 3
    Last Post: 04-22-2010, 12:13 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