Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-02-2009, 03:16 AM
joe41 joe41 is offline
Spammer
 
Join Date: 26 Feb 2009
Location: U.S
MS Office Version:Outlook
Posts: 59
joe41 is becoming part of the community
How can i Select a Report From Dropdown

Please Register to Remove these Ads

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:
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];
The code behind the button opening the report is:

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
Reply With Quote
  #2  
Old 06-02-2009, 12:11 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: How can i Select a Report From Dropdown

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!
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump