Report using all entries in a combobox

sponge

Registered User.
Local time
Today, 08:45
Joined
Jul 12, 2005
Messages
44
Hi,

I currently have a report that is driven by a combobox. I was wondering if there's a simple way to create a report for each of the entries in the combobox through a "All" combobox entry. (i.e. instead of selecting each entry, one by one)

Any help would be much appreciated.
 
Last edited:
I use a Union query and a select case to decide what to print. You need to write the Union query in SQL, so presuming you are using the primary key to set the criteria maybe try the following;

Set the Row source type of your combo box to Table/Query

Set the Row source to something like: SELECT tblBuilding.BuildingID, tblBuilding.BuildingName FROM tblBuilding UNION SELECT "0","ALL" FROM tblBuilding;

Set the Column Count to 2.

Then in the On Click event of your command button, use a select case:

Select Case ComboBoxName
Case 0
Docmd.OpenReport "Your Report Name"
Case Else
Docmd.OpenReport "Your Report Name", , , "BuildingID = " & Me.ComboBoxName
End Select

Dave
 
Hi,

Thanks for the reply.

The report I have is parameter driven - I already use
Docmd.OpenReport "Your Report Name"

on the OnClick event for the report.

It follows the same sort of schema as the crosstab report sample (under creating advanced reports) in the Microsoft Developer Solutions sample database:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bapp2000/html/mdbdownload.asp

Is there a way to utilize this schema to get what I want? Basically, right now a report will print taking in the selected name from the combobox and print that name beside a name label and its associated records below. I want to be able to choose an "All" entry in the combobox that will create a report that will show each person's report, one after the other (using something such as a page break) - sort of like 'grouping' by name....
 
Last edited:

Users who are viewing this thread

Back
Top Bottom