-
Combo Box showing reports
Hello all
Is it possible to have a combo box on a form, that will list all the reports held within the database, and then the user can select multiple reports to run at the same time.
If it is possible can anyone give me a push in the right direction as to how to accomplish this
Thanks in advance
Mav
-
Mav
You can't make multiple selections from a combobox, for that you would need a listbox.
If you do want to use a combobox try this.
1 Create a new form.
2 Add an unbound combobox and set it's Row Source property to this.
SELECT [MSysObjects].[Name], [MSysObjects].[Type] FROM MSysObjects WHERE ((([MSysObjects].[Type])=-32764));
3 Add a command button and add this for it's click event.
[vba]
Private Sub Command2_Click()
DoCmd.OpenReport Combo0.Value, acViewPreview
End Sub[/vba]
-
Ta for the response
However it is early and I am sure I am missing something in this code.
When I put it in the code you suggested in the Row the report names do not come up, all I get is two options
The first option I get it
SELECT [MSysObjects].[Name]
The second option I get is
[MSysObjects].[Type] FROM MSysObjects WHERE ((([MSysObjects].[Type])=-32764));
I am sure I need to change some of the code but I have still not had any coffee yet this morning and need another 6 hours sleep to fully function.
Ta for the help
Mav
-
Mav
You also need to change the Row Source Type to Table/Query.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules