Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Records

Status
Not open for further replies.

hdgirl

Technical User
Feb 2, 2002
131
GB
Hi

How do i get a report to filter records. I have a combobox that you can select a department from i would then like the report to show all the records for that department....help very confused with this CJB
 
Here is a method...In the click event of your combo box enter something like:

DoCmd.OpenReport "rpt_reportname", acPreview, , _
"[fld_department]=[Forms]![frm_frmname]![cbo_comboboxname]"

This will match the fld_department from your data source to the bound column in your combo box.
 
Thanks i tried this but there were no events available for the combobox within a report???????????? CJB
 
In the example given, I am launching the report from a form. The VBA just mentioned resides in a combobox on the form. When the user selects an item from the combobox, the code previews the report with the filtered results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top