Configurate a Check box function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I create a check box that has no function. The only thing that I want is
if the Check box is checked, it preview a report, if not ir print.

I need that when the form is open the check box appers automatically
checked. So if I wanto to print instead of preview I undcheck.

Is it possible?

Marco
 
Hi. I create a check box that has no function. The only thing that I want is
if the Check box is checked, it preview a report, if not ir print.

I need that when the form is open the check box appers automatically
checked. So if I wanto to print instead of preview I undcheck.

Is it possible?

Marco

Set the default value property of the check box to
-1

Code a command button on the form to open the report:

If Me![CheckBoxName] = -1 then
DoCmd.OpenReport "ReportName", acViewPreview
Else
DoCmd.OpenReport "ReportName"
End If
 
Hello,

It returns me an error sayng that "I can't assign a value to this object".


Regards,
Marco
 
Hi.

Yes, that's what I want to do. But first Ineed that the check bok appears as
checked when I open the form.

Regards,
marco




fredg said:
Hi. I create a check box that has no function. The only thing that I want is
if the Check box is checked, it preview a report, if not ir print.

I need that when the form is open the check box appers automatically
checked. So if I wanto to print instead of preview I undcheck.

Is it possible?

Marco

Set the default value property of the check box to
-1

Code a command button on the form to open the report:

If Me![CheckBoxName] = -1 then
DoCmd.OpenReport "ReportName", acViewPreview
Else
DoCmd.OpenReport "ReportName"
End If
 
Hi.

Yes, that's what I want to do. But first Ineed that the check bok appears as
checked when I open the form.

Regards,
marco

fredg said:
Hi. I create a check box that has no function. The only thing that I want is
if the Check box is checked, it preview a report, if not ir print.

I need that when the form is open the check box appers automatically
checked. So if I wanto to print instead of preview I undcheck.

Is it possible?

Marco

Set the default value property of the check box to
-1

Code a command button on the form to open the report:

If Me![CheckBoxName] = -1 then
DoCmd.OpenReport "ReportName", acViewPreview
Else
DoCmd.OpenReport "ReportName"
End If

Well, I think that's what I gave you.
Set the default value to -1 (or True)
Close and save the form changes.
Re-open the form and the check box should be checked.
Or, use Doug's method (in his second post) to set the value to -1 (or
True) in the form's load event.
 
Back
Top