Passing data to an unbound text box in a report

J

James Frater

Hello All,

We have one report that we use to display different variations of data from
the same table. For example the same report churns out bookings by week,
bookings by event, bookings by location, bookings by customer etc etc.

As part of the code for the button click would there be anyway I could pass
text to an unbound text box in the report header?

Many thanks

JAMES
 
A

Allen Browne

Assuming Access 2003 or 2007, you could use the OpenArgs of OpenReport,
e.g.:
DoCmd.OpenReport "Report1", acviewPreview, , OpenArgs:="Show this"

Then on the report, set the Control Source of a text box to:
=[Report].[OpenArgs]

For earlier versions, use a public string variable.
 
J

James Frater

Thanks Allen,

Works beautifully.

Cheers Mate

JAMES

Allen Browne said:
Assuming Access 2003 or 2007, you could use the OpenArgs of OpenReport,
e.g.:
DoCmd.OpenReport "Report1", acviewPreview, , OpenArgs:="Show this"

Then on the report, set the Control Source of a text box to:
=[Report].[OpenArgs]

For earlier versions, use a public string variable.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

James Frater said:
Hello All,

We have one report that we use to display different variations of data
from
the same table. For example the same report churns out bookings by week,
bookings by event, bookings by location, bookings by customer etc etc.

As part of the code for the button click would there be anyway I could
pass
text to an unbound text box in the report header?

Many thanks

JAMES
 

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