PDA

View Full Version : Combo Box showing reports



Mavver
05-15-2007, 07:08 AM
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

Norie
05-15-2007, 09:19 AM
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.

Private Sub Command2_Click()
DoCmd.OpenReport Combo0.Value, acViewPreview
End Sub

Mavver
05-16-2007, 01:18 AM
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

Norie
05-16-2007, 07:34 AM
Mav

You also need to change the Row Source Type to Table/Query.