I've decided to create the filter in the form, rather than a separate module.
After reading the threads, it's apparent that it's better to use the Where
condition in DoCmd.OpenReport, rather than the Filter.
The problem I'm having now is that even hardcoding the where, the report
doesn't filter for the desired results.
strReportWhere = "qryFillingDetailReport!ProductID = 'AMP'"
DoCmd.OpenReport "rptFillingDetail", acViewPreview, , strReportWhere
All product codes are reported.
And, yes, there are records where ProductID = 'AMP'.
Eventually, I want to replace the hardcoded AMP with the table and ProductID
the user selected.
Any help would be appreciated. Thanks.
Douglas J Steele wrote:
>It would probably be a little easier to name the table
>"tblProductSelectFilling" & Format(Time(), "hhnnss")
>
>That having been said, you can change the RowSource for your form to use the
>table name you pass to it.
>
>> I have a form which collects parameters to run a report. One of the
>> parameters collects a list that populates a table. I wanted to make the list
>[quoted text clipped - 9 lines]
>> I can pass the name of the table to the module that creates the filter, but
>> how do I use that varible to reference the value in the table?
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...dules/200604/1