Click to See Complete Forum and Search --> : If..Then..Else Statements with check boxes


kazooie21
November 9th, 1999, 04:22 PM
How do I code check boxes in an If..Then..Else statement?

kazooie21

November 9th, 1999, 06:46 PM
you can do something like this:

Dim Check1var as Boolean

Check1var = Check1.Value 'This puts the value of the checkbox in the variable

If Check1var = true then
MsgBox "Check1 is Checked"
else
MsgBox "Check1 is Not Checked"
End If

santulan
November 9th, 1999, 09:49 PM
Kazooie,
Check Box normally have two values 1 for checked and 0 for NOT checked.
Not only IF...THEN...ELSE..ENDIF But like FOR...NEXT... WHILE...WEND etc can be used to assign or to check the check box status.
IF...THEN...ELSE...ENDIF Block is mainly used to check or to assign the values to check Box. A small example -

Selected = false
if check1.value = 1 then
Selected = true 'Selected is a boolean variable
endif






Santulan