Use of checkbox to select when textbox gets printed.

C

Charlie

-Access 2000-

I am using a form to select data for printing on a
report. There is a checkbox on the form to have today's
date printed on the report, or left blank to be hand
written in later.

On the report, there's an unbound textbox for the DATE
where I want today's date printed only if the checkbox is
selected on the previous form.

How should I do this? Once the choices are made in the
form, it closes when you choose OK. Then the report
opens. Should this be done with an expression in the form
or in the report? A seperate query?

Please respond by email if possible.

Thanks a ton.

Charlie Brown
DSH Interactive
(e-mail address removed)
 
F

fredg

-Access 2000-

I am using a form to select data for printing on a
report. There is a checkbox on the form to have today's
date printed on the report, or left blank to be hand
written in later.

On the report, there's an unbound textbox for the DATE
where I want today's date printed only if the checkbox is
selected on the previous form.

How should I do this? Once the choices are made in the
form, it closes when you choose OK. Then the report
opens. Should this be done with an expression in the form
or in the report? A seperate query?

Please respond by email if possible.

Thanks a ton.

Charlie Brown
DSH Interactive
(e-mail address removed)

Add an unbound control to the report where you wish to print the date.
Set it's control source to:
=IIf(forms!FormName!CheckBoxName=-1,Date(),"")

Do NOT close the form.
The form with the check box must be open when the report is run.
You can make it not visible (Me.Visible = No) when the command button
is clicked.
Then close the form from the Report's Close event:
DoCmd.Close acForm, "FormName"

Actually, in my opinion, you should be opening the report first.
Code the Report's Open event to open this form:
DoCmd.OpenForm "FormName", , , , , acDialog

Code the Report's close event as suggested above.

Code the Form's Command Button's click event:
Me.Visible = false

The report will open the form.
Processing will stop until you enter the data in the form.
Enter whatever data you need in the form.
Click the command button.
The form will hide. The report will display, then when the report is
closed, the form will also be closed.
 

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