Forms

B

bob

What is the correctway to initialize a checkibox so that the check
mark appears? With this initialization, if
strFormBooleanReplaceConfirmEachChangeOption = "True" the program goes
to ChB05_Click

tia


Private Sub UserForm_Initialize()

If (strFormBooleanReplaceConfirmEachChangeOption = "True") Then
ChB05 = "True"
End If

end sub

Private Sub ChB05_Click()

If (bInitializationComplete = True) Then
If (strFormBooleanReplaceConfirmEachChangeOption = "False") Then
strFormBooleanReplaceConfirmEachChangeOption = "True"
Else
strFormBooleanReplaceConfirmEachChangeOption = "False"
End If
End If

End Sub
 
H

Henry

Bob,

Clicking on a CheckBox toggles it's True/False value without code.
If you need to ensure that (bInitializationComplete = True) before you allow
the change then

Private Sub ChB05_Click()
'Click switches the value
If (bInitializationComplete = False) Then ChB05.Value = Not ChB05.Value
'This switches it back again
End Sub

Initialise the Checkbox with
ChB05.Value = True

HTH
Henry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top