Print Title on Report from form filter

M

mpjm

how can i create the title for my report based on the filtered criteria
in a form? the form opens the report and i want the report to have the
title of what was filtered.

the user can filter among many things (usually only one, though) on the
form, and i would like to get whatever was filtered on the report as
the title

i have the basics down, like having an unbound text box and having
=[filter] in there to show what is being filtered, but i want to
display it in a more presentable and readable fashion.

for example, i would get this: "(((proposal.KEY_PERSON="Test"))) and
instead i want it to display as "KEYPERSON=TEST" (without the
parentheses and preceding 'proposal')

any help appreciated!
 
O

OfficeDev18 via AccessMonster.com

You can tack whatever text you want onto your .OpenReport statement; just use
the

DoCmd.OpenReport "YourReport",,,,,"Put text here"

format. In your report's Open event, you must capture the string, as follows:

Assuming your report's title box is called MyTitle, you would have the
following line:

Me.MyTitle = Me.OpenArgs

I'm not 100% sure it will work if MyTitle is a label, but it's simple to
change the label to a textbox (right click on the label and select Change To).


You understand that you will have to do all the legwork in your form's
routine, before calling the OpenReport method, in properly massaging the
string the way you want it. No shortcuts here, unfortunately. Also, the
MyTitle box may have to be very large to accommodate all the text.

Hope this helps,

Sam

how can i create the title for my report based on the filtered criteria
in a form? the form opens the report and i want the report to have the
title of what was filtered.

the user can filter among many things (usually only one, though) on the
form, and i would like to get whatever was filtered on the report as
the title

i have the basics down, like having an unbound text box and having
=[filter] in there to show what is being filtered, but i want to
display it in a more presentable and readable fashion.

for example, i would get this: "(((proposal.KEY_PERSON="Test"))) and
instead i want it to display as "KEYPERSON=TEST" (without the
parentheses and preceding 'proposal')

any help appreciated!
 

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