Define report header from a cmmd button

  • Thread starter Thread starter myxmaster
  • Start date Start date
M

myxmaster

Is it possible to define the report header based on a selected command
button. For example if I have 3 command buttons, Week, Month and Year,
if I select "Month" I would like the report to state Monthly in the
header.
TIA
 
Is it possible to define the report header based on a selected command
button. For example if I have 3 command buttons, Week, Month and Year,
if I select "Month" I would like the report to state Monthly in the
header.
TIA

Sure.
Add an unbound text control to the Form.
Name it txtPeriod
You can make it not visible if you wish.

Code the appropriate command button:
Me.[txtPeriod] = "Monthly" (or "Weekly", etc.)
Docmd.OpenReport "ReportName", acViewPreview

In the Report header, add an unbound text control.
Set it's Control source to:
=forms!FormName!txtPeriod

Note: the form must be open when the report is run.
 

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

Back
Top