DoCmd.OpenReport with Where condition - how to show Where value on report

  • Thread starter Thread starter brucek
  • Start date Start date
B

brucek

Hi, I'm opening a report from code and I'm using the Where parameter of
the OpenReport method.

Is there a way I can reference all or part of that where condition in
the report itself and print it in the Report or Page Header?

thanks,
Bruce
 
Hi, I'm opening a report from code and I'm using the Where parameter
of the OpenReport method.

Is there a way I can reference all or part of that where condition in
the report itself and print it in the Report or Page Header?

Seen that you are opening the report from code, you can put the Where condition
into a variable and use either in the OpenReport statement or elsewhere.
 
Hi, thanks for writing back. I open the report from a different form,
will the report know about variables from the calling form?

thanks,
Bruce
 
Hi, thanks for writing back. I open the report from a different form,
will the report know about variables from the calling form?

In this case you have to deal with a form control.
You can have an hidden textbox on your calling form.
You assign it the where condition (as a string value ) then you can read
it from the called report in the way Forms("yourformnamehere").Controls("yourtextboxnamehere").

Bye.
 
Ah, that's dumb of me, I'll try that. Thanks :)
In this case you have to deal with a form control.
You can have an hidden textbox on your calling form.
You assign it the where condition (as a string value ) then you can read
it from the called report in the way Forms("yourformnamehere").Controls("yourtextboxnamehere").

Bye.
 
Hello brucek,
You wrote in conference microsoft.public.access.adp.sqlserver on 7 Aug 2006
05:46:24 -0700:

b> Hi, I'm opening a report from code and I'm using the Where parameter of
b> the OpenReport method.

b> Is there a way I can reference all or part of that where condition in
b> the report itself and print it in the Report or Page Header?

Yes, you will find it in the property ServerFilter. Put textbox with
controlsource =serverfilter .

Vadim Rapp
 
Back
Top