Share via

Bound Checkbox on continious from

Anonymous
2010-07-01T17:41:17+00:00

I was attempting to use an unbound checkbox on a form...which thanks to the advice I recieved here...I quickly bailed. I have sense bound the check box to table ISRt![PO]. Now when I click the check box on the form only the checkbox I check is visually changing...which is good. The problem is I have a code that runs on click  

Private Sub PO_Click()

If Me!PO = -1 Then

Me![MASTER MODEL].Enabled = True

Me![MASTER CAGE].Enabled = True

Me![MASTER SERIAL NUMBER].Enabled = True

Else

Me![MASTER MODEL].Enabled = False

Me![MASTER CAGE].Enabled = False

Me![MASTER SERIAL NUMBER].Enabled = False

End If

End Sub

As soon as I click the check box all of the fields that are supposed to be blocked are now enabled. I only want the field in the record selected to be enabled if that makes any sense.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-07-01T17:54:07+00:00

It sounds like your form is in continuous view.  If so, that is the normal behavior when you use VBA code to set properties for an unbound control.  There is only one control with one set of properties so a;; copies of the code appear the same.

The only way I know of to get the effect you want on a continuous form is to remove that code and use Conditional Formatting (Format menu).  Use the Expression Is  option on the three controls with the expression:   [PO] = False  with the Enabled property set to off.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2010-07-01T17:47:16+00:00

There actually is only one Master Model control on the form, and onlyone Master Cage, and so on - each displayed many times. So changing the control's property changes all of the instances of the control!

The solution is to not use any VBA code at all; instead, open the form in design view, select the MASTER MODEL, MASTER CAGE and MASTER SERIAL NUMBER controls, and use the Conditional Formatting menu option (in 2003) or ribbon tool (in 2007) to make the control enabled or not based on the value of the PO control.


John W. Vinson/MVP

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful