hockey8837
Registered User.
- Local time
- Today, 09:49
- Joined
- Sep 16, 2009
- Messages
- 106
Hi,
I'm trying to generate a report off of a form with combo/list boxes that will filter the report parameters. I'm doing this for several forms/reports, but generally need the same thing for all.
For example, I have a form for my programs which has a combo box "cboYear" to select a year, based off of [progdate] and formatted as "yyyy" so the user can select what year they want their reports from. But, I also have a cascaded combo box "cboProgramTitle" that is based off of the [progdate] box, and only shows programs selected for the "cboYear". The code below will run the report and filter if something is selected for "cboProgramTitle", or returns all if left blank. How do I also get it to return all programs for the "cboyear", since this is already a 'formatted' version of [progdate], if a year is selected, but "cboProgramTitle" is left blank?
I've attached a sample of my DB, the form in question can be found by clicking the command button in the 'programs/events' tab. I've run into this same problem for the forms/reports in the 'tours' and 'tz' tabs, too. Need help filtering reports off multiple combo/list boxes, with one of them being the year list, or others being month or quarter lists.
Thanks in advance!
I'm trying to generate a report off of a form with combo/list boxes that will filter the report parameters. I'm doing this for several forms/reports, but generally need the same thing for all.
For example, I have a form for my programs which has a combo box "cboYear" to select a year, based off of [progdate] and formatted as "yyyy" so the user can select what year they want their reports from. But, I also have a cascaded combo box "cboProgramTitle" that is based off of the [progdate] box, and only shows programs selected for the "cboYear". The code below will run the report and filter if something is selected for "cboProgramTitle", or returns all if left blank. How do I also get it to return all programs for the "cboyear", since this is already a 'formatted' version of [progdate], if a year is selected, but "cboProgramTitle" is left blank?
Code:
Private Sub cmdAttendees_Click()
If IsNull(Me.cboProgramTitle) Then
DoCmd.OpenReport "rptProgramAttendees", acViewReport
Else
DoCmd.OpenReport "rptProgramAttendees", acViewReport, , "ProgramIDFK = " & cboProgramTitle & ""
End If
End Sub
I've attached a sample of my DB, the form in question can be found by clicking the command button in the 'programs/events' tab. I've run into this same problem for the forms/reports in the 'tours' and 'tz' tabs, too. Need help filtering reports off multiple combo/list boxes, with one of them being the year list, or others being month or quarter lists.
Thanks in advance!