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

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
 
P

PBsoft

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

brucek

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
 
P

PBsoft

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

brucek

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

Vadim Rapp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top