H
hermanko
Hi all,
I have a form based on a query that includes a Yes/No field as
checkboxes. I have a command button on the form footer that is default
at disabled when the form is opened (the checkboxes are all cleared as
well).
I need to enable the button once any checkbox is selected. The code I
have now only works partially. For example if i click any one checkbox,
the button enables fine. When i uncheck, it disables fine. The problem
occurs when I check several boxes, and as soon as I uncheck any one
box, the button will disable, even tho I still have other boxes
checked. Basically I need to fix my code so that when ANY one or more
checkbox is True i need the button to remain enabled. It doesn't sound
too hard to fix but i'm not strong with VB. My code is placed in the
AfterUpdate
event on the checkbox control:
Private Sub Yes_No_AfterUpdate()
If Me![Yes/No] Then
Me!cmd_remove1.Enabled = True
Else
Me!cmd_remove1.Enabled = False
End If
End Sub
I am thinking that it's acting this way BECAUSE i am running the code
at each individual checkbox. But i need a way for the form to see if
ANY one or more checkbox on the entire form is selected, and thus keep
the button enabled.
Any help would be great!
Herman
I have a form based on a query that includes a Yes/No field as
checkboxes. I have a command button on the form footer that is default
at disabled when the form is opened (the checkboxes are all cleared as
well).
I need to enable the button once any checkbox is selected. The code I
have now only works partially. For example if i click any one checkbox,
the button enables fine. When i uncheck, it disables fine. The problem
occurs when I check several boxes, and as soon as I uncheck any one
box, the button will disable, even tho I still have other boxes
checked. Basically I need to fix my code so that when ANY one or more
checkbox is True i need the button to remain enabled. It doesn't sound
too hard to fix but i'm not strong with VB. My code is placed in the
AfterUpdate
event on the checkbox control:
Private Sub Yes_No_AfterUpdate()
If Me![Yes/No] Then
Me!cmd_remove1.Enabled = True
Else
Me!cmd_remove1.Enabled = False
End If
End Sub
I am thinking that it's acting this way BECAUSE i am running the code
at each individual checkbox. But i need a way for the form to see if
ANY one or more checkbox on the entire form is selected, and thus keep
the button enabled.
Any help would be great!
Herman