Access 2010 how to use a navagation form to collect parameters run reports

gus318

New member
Local time
Today, 05:19
Joined
Oct 15, 2011
Messages
4
Access 2010 how to use a navagation form to collect parameters run reports?
I have created a db and I want to use a tab on the navagation form to show about 5 titles of reports (command buttons). I want the end user to be able to set Start Date and End Date, and use a combo box to select the event and view one of the reports. Any help would be most welcome!
Gus
 
I assume the event selected by the combo box is a criteria for the report, i.e. corresponds to a value in a field?

OK, on the form, add text boxes for start date and end date for the user to fill in and also add your combo box for the user to select an event.

Then, in the query for each report, the criteria for your date field should be:

Code:
Between [Forms]![yourFormName]![txtStartDate] And [Forms]![yourFormName]![txtEndDate]

The criteria for your event field should be:

Code:
[Forms]![yourFormName]![cmbEventCombo]

(remember to adjust the names above to match your actual text box and combo box names, or rename them on the form to match above).

On the buttons for each report, I would check to ensure the data has been entered or selected properly by the user:

Code:
If IsNull(Me.txtStartDate) Or IsNull(Me.txtEndDate) or IsNull(Me.cmbEventCombo) Then

MsgBox"You must choose a start date, end date and event"

Exit Sub 

End If

DoCmd.OpenReport "rptYourReportName"
 

Users who are viewing this thread

Back
Top Bottom