Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set conditional properties of check boxes on report

Status
Not open for further replies.

Chew407

Technical User
Mar 28, 2005
92
CA
Hello,

I am trying to change the properties of check boxes on my report depending on a number entered in a control on the corresponding form. The control is cboLaneNum. To give you an idea of what I am trying to accomplish here...

If cboLaneNum = 3 Then
chkL4.visible = False
chkL5.visible = False
chkL6.visible = False

So the last 3 check boxes do not show up... or I wouldn't mind changing the special effect property on the report. How is this done? Thank you for any help you can lend me.
 
In the On Format event of the section of the report containing the check boxes:

Me.chkL4.Visible = (Forms!frmYourForm!cboLaneNum <>3)
Me.chkL5.Visible = (Forms!frmYourForm!cboLaneNum <>3)
Me.chkL6.Visible = (Forms!frmYourForm!cboLaneNum <>3)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks dhookom,

I tried the code you suggested. Similarly with code I had tried I get an error message saying my main form can not find my form "frmAccident". The corresponding form must be open to open the report "rptAccident". How can I get around this? Can I open the form before opening the report and simply make the frmAccident invisible to the user?
Thanks again for your help.

Chew
 
By all means, open the form prior to opening the report. Yes, you can make it invisible.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top