Changing colors of a Text Box with VBA

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

I have a text box that is called: [TTX]
and I have a Option group starting 1-7.
depending on the option I want to change the background
color of the textbox [TTX] using VBA if possible.

Thanks, Allem
 
Allen said:
I have a text box that is called: [TTX]
and I have a Option group starting 1-7.
depending on the option I want to change the background
color of the textbox [TTX] using VBA if possible.

Thanks, Allem
Allen,
Code both the OptionGroup's AfterUpdate event
and the Form's Current event:

Select Case OptionGroupName
Case is = 1
[TTX].BackColor = vbWhite
Case is = 2
[TTX].BackColor = vbBlue
Case is = 3
[TTX].BackColor =12632256
etc.
Case else
[TTX].BackColor = vbRed
End Select
 
Back
Top