Reports in a Combo box (Simple)

Ollie_3670

Registered User.
Local time
Today, 12:28
Joined
Feb 1, 2010
Messages
50
Wasn't sure if this was a form or reports question, but eitherway, how do you put reports into a combo box? I've been able to successfully google how to look up records from a table in a combo box, now I need to be able to give a drop down list showing several reports

In my modify staff form, I want to show all reports that are based on staff, and when they are selected the reports are executed. Currently this totals a grand total of 1 report. But the ability for this to auto update when I add more staff reports would be useful

However, as a patchup job if someone simply knew how to do it without auto-updating the cbo.

Thanks!
 
I like Bob Larson's list box sample (which can be done using a combo as well) and you can modify it so that it fits your situation. But essentially by using a certain prefix the report will automatically be added to the list.
 
Looks like exactly what I want, (I'd start all mine with RptStaff_ or the like)

However I don't quite understand the query he uses as the row source of the list box.

I understand that a field has to contain the criteria "rpt_" but I don't know or understand what ''Left([Name],4)'' means.

That sysObjects database is so confusing! I understand Name is a field in it, which describes the type of object (perhaps?) but other than that..totally at a loss

Do I even need to understand it? Could I just copy and past straight from it into my database?
 
The Left part gets the first 4 characters from the name and the criteria of

rpt_

means that if that left 4 characters is rpt_ then it will include it in the list. If not, it won't. So to have the report show up in the list you just name your report

rpt_WHATEVER HERE and then it will show up in the list (without the rpt_ part).

You could copy it in and use it.
 
this is a shame! tried it with a list box first, worked a charm, then tried it with a combo box and for some reason with a combo box it doesn't block out the "rpt_"

this poses a little problem as the list box demands more space, where as a combo box i expandable

any ideas? Or should I bite the bullet and use list boxes?
 
this is a shame! tried it with a list box first, worked a charm, then tried it with a combo box and for some reason with a combo box it doesn't block out the "rpt_"

this poses a little problem as the list box demands more space, where as a combo box i expandable

any ideas? Or should I bite the bullet and use list boxes?

You just have to make sure to set the combo box properties correctly.

First, use the same row source as the list box.

Second, set the COLUMN COUNT to 2 and the Bound Column to 1.
 
Actually, you could just select the list box while in design view and go to FORMAT > CHANGE TO > Combo Box.
 
I thought that too, but I can't seem to see where that is, not sure if the option is available (using access 2007 by the way)
 
I thought that too, but I can't seem to see where that is, not sure if the option is available (using access 2007 by the way)

Oh, in 2007 you select the control and right-click and you should see the CHANGE TO on the popup menu.
 

Users who are viewing this thread

Back
Top Bottom