On my Main Menu, I have a combobox listing a couple reports. The goal is to select a report and then click a button to open it.
The combobox (called ReportList) record source is table [T-ReportList] so that the user selects the ReportName
ReportName |
ObjectName |
ListOrder |
Monthly Sales |
R-Monthtodatesales |
1 |
Monthly Samples |
R-Monthtodatesamples |
2 |
There is no Control Source since I don't need this saved anywhere.
The view report button has this on click event
Code:
Private Sub OpenReports_Click()
DoCmd.OpenReport DLookup("[ObjectName]", "[T-ReportList]", [ReportName] = [Forms]![Main Menu]![ReportList]), acViewReport
End Sub
The problem is that the button always and only brings up "R-MonthtodateSales" even if nothing has been selected or if I have selected Monthly Samples.