openargs for report filter

jasn_78

Registered User.
Local time
Tomorrow, 10:35
Joined
Aug 1, 2001
Messages
214
what i am trying to do is enable or disable report filters on a report depending on a check box i choose on a form everytime i do this with the following code i get an error messgage Error 2451 the report name doesnt exist when i know its there i dont get what i am doing wrong can some1 help please.

Code:
        Reports!rptACCOUNTRX.Filter = stwhere
        Reports!rptACCOUNTRX.FilterOn = True
        DoCmd.OutputTo acOutputReport, strrpt, acFormatPDF, "C:\TFRS REPORTS\" & strrpt & today & ".PDF"
        Reports!rptACCOUNTRX.FilterOn = False

Thanks in adavnce
Jason
 
What is the today part? if you are meaning the current date, in Access it is Date.
 
the today part bob sorry is part of an early code to format the date field to a 6 character number.
 
bob what i think my problem is im trying to apply the filters before opening the report but i dont know how to pass the filters to the report with openarg like i can to a form.

The reason i need to filter instead of criteria options as you would prob know is using the pdf output option doesnt let u use criteria. (which i still dont get y it doesnt) :(

If i can do something like this it would solve all my problems.
 

Users who are viewing this thread

Back
Top Bottom