Opening multiple reports with a list/combo box

S

Sandra

Hi, I am new to writing VBA and marcos and I was wondering if someone can
point me in the right direction.

I have a form that I want to use where is has a drop down list of reports
the a user can choose from and open. In the research that I have done it
shows how to do this for one report or a part of a report, but not if you
have several.

Note: I tried using the switchboard but messed up the coding and now it wont
work; any suggestion as to where I can go to figure out how to clean up my
mess? :)

Thanks
 
J

Jeff Boyce

Sandra

The way I implemented this capability was to create a table that holds the
Access report name in one field, a user-friendly report name in another
field, a description in a third (so the user can tell what s/he's getting),
and and other 'settings'.

Then I created a form that has a category combobox (pick the category of
report) and a listbox with the reports (showing only the user name) in the
chosen category (oops, add another field to the table for the report's
'category', and add a [Category] table to fill the category combobox). I
update the listbox in the AfterUpdate event of the category combobox.

I added a <Print Preview> command button, and code behind that button that
runs the OpenReport command. To get the name of the report, I have the code
look back up at the (2nd? 3rd? whatever?) column for the listbox.

I have also expanded on this by adding selection criteria controls and using
the WHERE clause of the OpenREport command to customize the reports.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Sandra

Thanks Jeff, I'll try this let you how I do :)

Jeff Boyce said:
Sandra

The way I implemented this capability was to create a table that holds the
Access report name in one field, a user-friendly report name in another
field, a description in a third (so the user can tell what s/he's getting),
and and other 'settings'.

Then I created a form that has a category combobox (pick the category of
report) and a listbox with the reports (showing only the user name) in the
chosen category (oops, add another field to the table for the report's
'category', and add a [Category] table to fill the category combobox). I
update the listbox in the AfterUpdate event of the category combobox.

I added a <Print Preview> command button, and code behind that button that
runs the OpenReport command. To get the name of the report, I have the code
look back up at the (2nd? 3rd? whatever?) column for the listbox.

I have also expanded on this by adding selection criteria controls and using
the WHERE clause of the OpenREport command to customize the reports.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP


Sandra said:
Hi, I am new to writing VBA and marcos and I was wondering if someone can
point me in the right direction.

I have a form that I want to use where is has a drop down list of reports
the a user can choose from and open. In the research that I have done it
shows how to do this for one report or a part of a report, but not if you
have several.

Note: I tried using the switchboard but messed up the coding and now it
wont
work; any suggestion as to where I can go to figure out how to clean up my
mess? :)

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top