Addie Baker
asked on
Filter Report by Combo Box in Access
i have a report that i would like to sort by selecting a value from a combobox
the combo box needs to be bound to unique records from a table (there are only 5 differet choices)
the report format stays the same just the data is dependent on what the value of the combobox is.
the combo box needs to be bound to unique records from a table (there are only 5 differet choices)
the report format stays the same just the data is dependent on what the value of the combobox is.
Alternatively, you can set criteria in the recordsource query of your report using a WHERE clause:
SELECT * from YourTable WHERE ID = Forms!YourFormName!YourCom boName
SELECT * from YourTable WHERE ID = Forms!YourFormName!YourCom
ASKER
recordsource query of your report
where is this??
where is this??
ASKER
okay i found that, but i would like the combo box to be on the report. so when you are looking at the report the combo box can be changed and the new info be printed
I don't have a copy of Access 2007 at the moment, and this sort of thing is not possible in earlier versions.
If Access 2007 Allows this type of functionality I imagine it would be similar to controling a form's filter property through a combo box. If that is the case, you would need code like this in the AfterUpdate event of your combo box:
Me.Filter = "ID = " & me.cboMyCombo
me.filteron = TRUE
If Access 2007 Allows this type of functionality I imagine it would be similar to controling a form's filter property through a combo box. If that is the case, you would need code like this in the AfterUpdate event of your combo box:
Me.Filter = "ID = " & me.cboMyCombo
me.filteron = TRUE
ASKER
where do i put my combo box on the report?
header?
detail?
header?
detail?
Try the header.
Again, I've got my doubts about this. I know A2K7 gives reports some more functionality - but I don't have a copy at the moment to try this out myself.
In A2k3, you would place the combo box on a form and open a filtered report through that form.
Again, I've got my doubts about this. I know A2K7 gives reports some more functionality - but I don't have a copy at the moment to try this out myself.
In A2k3, you would place the combo box on a form and open a filtered report through that form.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Docmd.openreport YourreportName,acviewprevi