On my main nav form in my Access 2010 db, I have a tab called 'Offerings' that displays a form with 2 unbound combo boxes. The 1st combo box displays a list of offerings from a field in one of my tables, and is used in the criteria of corresponding fields in my queries that feed my reports. The 2nd combo box is a list of report names.
I then have an unbound subreport, and a command button. The command button has an on click event procedure that is supposed to update the source object of the unbound subreport to the desired report, thereby allowing the user to select the offerings that they want to view, the desired report associated with that offering, and have the correct report with the correct data set display in the subreport object.
It all works beautifully for the 1st 'offering' listed in combo box #1. I can pick the report, click the command button, and view the desired report with the desired record set in the subreport object. However, if I select any other 'offering' in the list, it displays a blank record set. The correct headings for the fields in the selected report are displayed, so it is changing the report appropriately, there is just no data.
Interestingly, if I set combo box #1 to the desired offering and just open the desired report directly from the navigation pane, the report displays correctly.
My on click code for the command button is:
Private Sub cmdRunReport_Click()
Dim strSubRptName As String
strSubRptName = "Report.srp" & Me!cmbReport.Column(0)
Me!srpChild.SourceObject = strSubRptName
End Sub
The 'Offering' field in each of my queries used by my forms has [Forms]![Main]![NavigationSubform].[Form].[cmbDealSelect] as the criteria.
I'm quite stumped and running up against a deadline. Any help would be tremendous.
I then have an unbound subreport, and a command button. The command button has an on click event procedure that is supposed to update the source object of the unbound subreport to the desired report, thereby allowing the user to select the offerings that they want to view, the desired report associated with that offering, and have the correct report with the correct data set display in the subreport object.
It all works beautifully for the 1st 'offering' listed in combo box #1. I can pick the report, click the command button, and view the desired report with the desired record set in the subreport object. However, if I select any other 'offering' in the list, it displays a blank record set. The correct headings for the fields in the selected report are displayed, so it is changing the report appropriately, there is just no data.
Interestingly, if I set combo box #1 to the desired offering and just open the desired report directly from the navigation pane, the report displays correctly.
My on click code for the command button is:
Private Sub cmdRunReport_Click()
Dim strSubRptName As String
strSubRptName = "Report.srp" & Me!cmbReport.Column(0)
Me!srpChild.SourceObject = strSubRptName
End Sub
The 'Offering' field in each of my queries used by my forms has [Forms]![Main]![NavigationSubform].[Form].[cmbDealSelect] as the criteria.
I'm quite stumped and running up against a deadline. Any help would be tremendous.