Hulm1, Your code was almost correct. This line
If Me.AirSparging = True Then Me.Compressor = True
by itself would be correct. You can place an
If...Then statement on a single line, and if you do you don't need an
End If statement to match. But when you have an
If...Then statement on a single line,
you cannot have an Else statement as well. To add the
Else statement you have to use the standard
If...Then construct along with the
End If statement. So your code then becomes
- If Me.AirSparging = True Then
-
Me.Compressor = True
-
Else
-
Me.Compressor = False
-
End If
-
which is the same as lee123's code, because his statement
“
when you are dealing with these checkboxes you need to put the value of it in the code.”
is incorrect. Since
.Value is the default property of Checkboxes, comboboxes and textboxes,
Me.Compressor = True
and
Me.Compressor.Value = True
mean the same thing.
Welcome to TheScripts!
Linq
;0)>