Results 1 to 6 of 6
  1. #1
    MLangendorf is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    50

    ComboBox to enter parameter for report

    I want to use a combo box to enter the parameter criteria for a report. The report is based on a query that requires the entry of a specific "Agency".


    Instead of typing in long agency names to run the report I would like to be able to choose from a combo box to initiate the query for the report.
    How is this done. I have tried multiple ways but can't make it work.
    thanks for any help!

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    USE a form for user interaction.
    Put a combo on a form.
    The rowsource of the combo would be the list of parameters involved.

    User makes a selection, then in the after update of the combo,
    you modify the recordsource of the report involved, and open the report.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    USE a form for user interaction.
    Put a combo on a form.
    The rowsource of the combo would be the list of parameters involved.

    User makes a selection, then in the after update of the combo,
    you modify the recordsource of the report involved, and open the report.

    More info here at Martin Green's site

  4. #4
    MLangendorf is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    50
    Thank you, but how do I modify the record source of the report. through a macro?
    What New Action in a macro would do this step?

    thank you

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I don't use macros.

    In vba, a form would be open, the user selects from a combo
    then you modify the recordsource of the report.

    Here is how I revise the recordsource of a report from a combo on a form.

    This is the recordsource of the report
    Code:
    SELECT Product.* FROM Product WHERE (((Product.ProductCode)=[Forms]![frmProduct]![cboProductCode]));

  6. #6
    MLangendorf is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    50
    What worked better for my brain (given my limited abilities with VBA or SQL) was to make the combo box and then set the combo box as criteria in the query. Then in the 'after update' on the combo box I embedded a macro to Open Report.
    Seems to have done the trick.
    Thank you so much for your guidance!

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

Similar Threads

  1. Report 'Enter Parameter Value' Error
    By ndehhh in forum Programming
    Replies: 6
    Last Post: 10-18-2015, 05:18 PM
  2. ComboBox to Run Query and enter Parameter
    By tristangemus in forum Forms
    Replies: 13
    Last Post: 06-25-2013, 09:54 AM
  3. "Enter Parameter Value" At Report Run Time?
    By JeffGeorge in forum Access
    Replies: 5
    Last Post: 06-13-2013, 08:44 AM
  4. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  5. enter parameter value
    By alliandrina in forum Access
    Replies: 1
    Last Post: 06-05-2011, 01:02 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