Putting where condition on report

jgc31

Registered User.
Local time
Today, 11:40
Joined
Dec 4, 2004
Messages
78
I have a form which allows users to create a report by specifying various criteria to be included/excluded. The report is then created using "docmd.openreport" using a where condition based on the users selections. I would like to print the where condition on the report for reference and cant quite work out how.

I have tried the following code
"Reports!rptmemberinfopublic!txtSQLString = strSQL"
( txtSQLString being the name of the text box on the report and strSQL being the where condition string ) but I believe that as the report has already been created it won't work.

Any suggestions?
 
Is strSQL decleared as a public vairable. I have ran into this before and ended up going into Modules and creating a new module called variables and then declearing public variables there.

Public strSQL as String

then use

In the On Format Event in the reort section where the text box is place
me.txtSQLstring.Value = strSQL

Hope that helps
 
Thanks for this idea. I didn't use a public variable as this would mean creating a seperate module but created a hidden field on the form and then referenced this field in the on format event.
 

Users who are viewing this thread

Back
Top Bottom