Load a list box with all reports within DB

Sully38

Board Regular
Joined
Mar 9, 2004
Messages
167
I am looking to add a List box to a form that will allow the user to view any report contained within the DB. I want to make sure I am doing this correctly:

1. Is a List box the correct tool to use

2. Is the best way to pull the reports to use a query off SysObject module?

3. I am starting to get into this development stuff, its just very hard and frustrating not having another person to bounce ideas off, so I guess the fine folks at Mr. Excel are now working on the other side of my cube....Hello Neighbor!!

:rolleyes:
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
here is what I just came up with and it seems to work: on the
Form load prop
For Each accObject In CurrentProject.AllForms
Me.cobForms.AddItem accObject.Name
Next

Then I added a view report button and told it to
view me.cobreports

This is working but I want to make sure that there isn't a better mouse trap.
 
Upvote 0
Extra question...

I tried using the same code as above to allow the user to open specific forms, and while it works generally it won't allow to open any forms in DataSheet View, is there a trick to that?

Code to get Combo Box Loaded:
For Each accObject In CurrentProject.AllForms
Me.cobForms.AddItem accObject.Name
Next

Code to behind Button to View form:
stFormName = Me.cobForms
DoCmd.OpenForm stFormName

BTW.. It seems that Combo Boxes work better than List boxes for this.
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top