Full Version: Problem With Subreports On Nav Form
UtterAccess Forums > Microsoft® Access > Access Forms
OK, so I'm on the verge of being where I want to be with the nav form in my database, but have a little hiccup. The general idea is that I want to use dynamic subreports on a tab of my nav form that uses two unbound combo boxes to determine the report that displays. The first combo box displays a list of offerings that my firm is engaged in, which is pulled from a column in one of my tables. The underlying queries that drive my various reports each have the field Offering as one of the queried fields, and the criteria for Offering in the query = [Forms]![Main]![NavigationSubform].[Form].[cmbDealSelect], which is the 1st of the 2 combo boxes on my nav form. Therefore, when a report is opened, it displays only the records related to that deal, as it should.
The 2nd combo box on the nav form has a list of report names, minus the 'srp' that I use to signify that they are subreports. I have a command button on the form next to the 2 combo boxes with an on click event that has the following code:
Private Sub cmdRunReport_Click()
Dim strSubRptName As String

strSubRptName = "Report.srp" & Me!cmbReport.Column(0)

Me!srpChild.SourceObject = strSubRptName
End Sub
The desired effect is to select an offering, select the report that you want to review related to that offering, click the button and have that subreport display in the window.
It works fabulously when using the 1st Offering in the list of combo box #1. You can select any of the reports from the 2nd combo box, click the 'Go' command button, and the appropriate subreport displays.
The problem is that when you select any other offering from the list in box 1, select a report, and click go, the subreport window goes blank. I can open any of the reports directly from the navigation pane, and it displays the data that it should, so the underlying queries are clearly recognizing the offering that is selected in the 1st command button at [Forms]![Main]![NavigationSubform].[Form].[cmbDealSelect], but the forms aren't rendering in the subform object of the nav form when the on click event is triggered.
Any help would be huge!
Sorry, one point of clarification. The subreport object isn't completely empty. It displays the column headings of my subreports, but no data. When I move between subreports and click the command button, the headings update to reflect the correct report, but there is no data. However, again, if I open the report directly from the navigation pane, the correct data displays.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.