Hi everyone,
I have inherited a database that has a list of reports in a drop down. Whenever I select a report, the preview window will open but it will automatically default to the first report on the drop down list (even if I selected the 5th). How can I open ONLY the one selected from the drop down, rather than all of them each time (regardless of which I chose)?
The query behind the drop down is:
The code behind the button opening the report is:Code:SELECT [Overall Rankings].[Site ID], [Overall Rankings].[Site Name], [Overall Rankings].Address, [Overall Rankings].City FROM [Overall Rankings] ORDER BY [Overall Rankings].[Site ID];
Code:Private Sub btn_ViewSiteSummary_Click() On Error GoTo Err_btn_ViewSiteSummary_Click Dim stDocName As String stDocName = "Site File Review Summary Report" DoCmd.OpenReport stDocName, acPreview
Just at first glance. You are opening only one report, there is only one report, what you want to change is which website you are viewing the report for. Am I correct in my assumptions there?
Also if you want it to designate which data to open you need to set the Criteria in your DoCmd.OpenReport statment.
Hope this helps,
Dan
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks