Toggle text box properties based on option group value

R

Rebecca_SUNY

I have a text box that I want to lock, flat, and transparent when an option
group value is 3. I have that working but once it is 3 and changes, if I
change the option group value to 1 or 2, it doesn't change back. Is there
any why to "toggle" this without creating a nest If statement?

Here is the code so far...

Private Sub optOptionGroupControl_AfterUpdate()

Requery

If optOptionGroupControl = 3 Then
With TextBoxControl
.Locked = True
.SpecialEffect = 0
.BorderStyle = 0
.BackStyle = 0
End With
End If
End Sub
 
B

Beetle

Private Sub optOptionGroupControl_AfterUpdate()

Requery

If optOptionGroupControl = 3 Then
With TextBoxControl
.Locked = True
.SpecialEffect = 0
.BorderStyle = 0
.BackStyle = 0
End With
Else
With TextBoxControl
.Locked = False
.SpecialEffect = x
.BorderStyle = x
.BackStyle = x
End With
End If
End Sub

where x = whatever numeric value applies to the effect you want.
 

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