Results 1 to 6 of 6
  1. #1
    Lowell is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Location
    Manitoba, Canada
    Posts
    54

    Unhappy Opening form with parameter query

    I have a very basic structure, two tables. I have buyers and their basic details in one table. I have the items they bought in another table. I can make a form off of the buyers table with a subform listing the items bought. I want to be able to click the 'open form' command button on my switchboard and have a parameter query or something equal come up so I can see the items bought by the individual buyer in the form when it opens. I have tried to make a parameter query but it always makes the number of records equal to the number of items purchased. So, when I get to the form then i have to go through a few records to see all the items. There must be a way. I can get the form I want by making it off the buyers table because the subdatasheet then becomes the subform, but that is without the parameter and I don't want to search through all the records to come up with the right buyer every tine. I know there is a way. I have searched this forum and others and can't find an answer to my question. Please help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Are you searching for a specific buyer or just some of a buyer's purchases or both?

    Options for opening filtered form or report:

    1. Query input parameter prompt for each field that needs filter criteria. I never use this because cannot validate user input.

    2. Input parameters in controls on form. Query refers to the controls for filter criteria.

    3. WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport). Again, user input parameters on form and code refers to controls for filter criteria.
    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
    Lowell is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Location
    Manitoba, Canada
    Posts
    54
    Thanks for your prompt reply. I am just learning to program in Access and don't really understand VBA. The only time I do any programming is on evenings and Saturdays. I have been busy. If you wouldn't mind I could gladly use a little bit of detail in describing where to put the parameter prompt.

    I am searching for a specific buyer with all its purchases. Am I understanding correctly that I need to put parameters on the form when it opens? Is that done in the properties box of the form?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Refer to this article for option 1 http://office.microsoft.com/en-us/ac...001097065.aspx

    Refer to this tutorial for option 2 http://datapigtechnologies.com/flash...tomfilter.html

    Refer to previous post for option 3
    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
    Lowell is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Location
    Manitoba, Canada
    Posts
    54
    The tutorial option from datapigtechnologies helped me the best. Thank you!

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

Similar Threads

  1. Use form control value as parameter for query
    By jpkeller55 in forum Access
    Replies: 2
    Last Post: 02-07-2012, 06:09 PM
  2. Stop Form from opening when query is blank
    By anpmm2 in forum Access
    Replies: 1
    Last Post: 12-16-2011, 04:18 PM
  3. Before query event when opening form
    By tuna in forum Forms
    Replies: 7
    Last Post: 05-31-2010, 10:35 AM
  4. Pass a Parameter From a form to a Query
    By DDillesha in forum Forms
    Replies: 1
    Last Post: 10-28-2009, 12:49 PM
  5. Report with Parameter Query/Form
    By maggioant in forum Reports
    Replies: 0
    Last Post: 10-09-2009, 09:48 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