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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wayward filter

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a form tht opens a report. My form has some controls that allow the user to filter information. I am using the following code to open the report with the appropriate filter:

Dim condition as string
condition = "[Tech_ID] = 5"
DoCmd.OpenReport stDocName, acViewPreview, condition

The filter doesn't seem to be applying to the report. I have entered the above string in the "Filter" properties of the form, and it works just fine. (FilterOn is set to yes). Any ideas on what's going on? I have also tried to input the condition as the WhereCondition in the DoCmd.OpenReport line, but that doesn't seem to be working either. Any ideas? Thanks.
 
Try this...

Dim condition as string
condition = Me.Filter
DoCmd.OpenReport stDocName, acViewPreview, condition
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top