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.
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.