Make control item flash on form at GotFocus

  • Thread starter Thread starter Sue C.
  • Start date Start date
S

Sue C.

1. I want to set up an event procedure in a form so that
when the Option Group "optType" receives the focus (after
tabbing to it), then the option group label would flash
(change color), so the user would know that's where the
focus is (it's not clear to them). I set up the prcoedure
to change the label back and forth from black on white to
white on black. I have the colors defined in a Dim
statement.

I was looking through help, and it showed examples using
Form_Load and Form_Timer events, which I've tried, but I'm
not getting it to work. The option group properties have
visible, enable and tab stops all set to Yes. It compiles
OK, but when the form loads, I get a "Run-time error 438.
Object doesn't support this property or method" message.

When the form loads, it stops at the first line of the
command:
"If Me!optType.GotFocus Then"
I'm not sure if I need to reword the entire command or
what syntax to use, and I'm not sure if it really should
be on the Form_Load event or a different event. Or maybe
there is something else wrong.

2. When the option group gets the focus, it goes to the
first option radio button alphabetically in the option
group, which is not the first button. Is there a way to
have it stop at the 1st option button within the group
instead.
 
1) When the form loads try

If Me.ActiveControl.Name="optType" Then
'etc
End If

2) I show that it should go to the option button that is the current value
of the option group. Have you tried setting the Default Value of the group
to the value of the first button?
 
Back
Top