Opening report and passing value from form combobox

AccessNoob67

New member
Local time
Today, 10:20
Joined
Aug 22, 2023
Messages
6
Hello all,
Complete access noob so please be gentle. I have a report, a query and a form. The query requires a criteria to be entered in order for the report to be populated. Right now if I open the report I get the box to type in the criteria, as to be expected. What I would like to happen is when the report is opened it triggers the form with the combobox to open, I select the value and that value is passed to the query and the report populated. Not at all sure how to go about this. Any help would be appreciated. TIA.
 
Little backward I would have thought?
Usual scenario is to have a form and some form of opening a report, like a button.
Then you pass the ID of the current record to the WHERE argument of the OpenReport command.

For criteria in the query, you can refer to the form controls if they can be part of the criteria.
 
Little backward I would have thought?
Usual scenario is to have a form and some form of opening a report, like a button.
Then you pass the ID of the current record to the WHERE argument of the OpenReport command.

For criteria in the query, you can refer to the form controls if they can be part of the criteria.
Like I said....total Noob. Okay....so better practice is to open the form, select the value from the combobox, and then click a button that will open the report and pass the value. How do I do that?
 
Open the query on which your report is based in the design window and refer to the criteria part of the relevant criteria field in the drop-down box on your form.
 
Open the query on which your report is based in the design window and refer to the criteria part of the relevant criteria field in the drop-down box on your form.
Okay...so that would be something like putting the form name and the combobox name in the criteria field?
 
Hi. Welcome to AWF!

If you're going to use a form and a button to open the report anyway, you might also be able to skip the criteria part in your query. You can easily filter the report using code.
 
Thank everyone. Was able to get it figured out with all the pointing in the right direction.
 

Users who are viewing this thread

Back
Top Bottom