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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba checkbox problem

Status
Not open for further replies.
Sep 25, 2007
1
US
I have not done much with Microsoft Access so I have not been able to figure this out. I have a report with 3 check boxes on it (checkbox1, checkbox2, checkbox3). I also have a label on this report (tmpLabel). What I am trying to do is on the onOpen of the report, if checkbox1 is checked make the caption of tmpLabel equal to some value, check box 2 is a different caption etc. The value for the checkbox is stored in a table as a yes/no. I am trying this

If me.checkbox1.enabled = True then
Me.tmpLabel.Caption = "Checkbox 1 checked"
elseif etc....

When I try to run it, I get something about invalid references. Any help is appreciated.
 
I've never used a checkbox on a report before, but the Open event of the report won't work, as the controls you reference haven't been created yet.

Before you criticize someone, you should walk a mile in their shoes.
That way, when you criticize them, you're a mile away and you have their shoes.
 
are these checkboxes bound?

also, you're comparing the .enabled property, shouldn't this be the .value property?

use the onFormat event...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top