A
Amit
Hi,
I have a form which has many controls, two of which are a
combo box and a textbox. The textbox is visible and
enabled only if a certain value ("Inactive") is selected
in the combo box. I have the following code (thanks to one
of the MVPs here) in the 'Enter' and 'AfterUpdate' events
of the combo box:
Me.StaffStatusChangeDate.Visible = (Me.StaffStatus
= "Inactive")
Me.StaffStatusChangeDate.Enabled = (Me.StaffStatus
= "Inactive")
Also, in the GetFocus event of the textbox, I set focus to
the combo box if the value is "Active".
This is working fine except for one glitch. When I move
from one record to the next in the form using the
navigation keys, and if the cursor happens to be in a
control other than the combo box or the textbox, the
textbox is displayed even if the combo box is "Active".
I think I need to place the same code in some other
control in the form, so that the textbox is displayed/not
displayed irrespective of the control where the cursor is
when I navigate. Any pointers??
Thanks!
-Amit
I have a form which has many controls, two of which are a
combo box and a textbox. The textbox is visible and
enabled only if a certain value ("Inactive") is selected
in the combo box. I have the following code (thanks to one
of the MVPs here) in the 'Enter' and 'AfterUpdate' events
of the combo box:
Me.StaffStatusChangeDate.Visible = (Me.StaffStatus
= "Inactive")
Me.StaffStatusChangeDate.Enabled = (Me.StaffStatus
= "Inactive")
Also, in the GetFocus event of the textbox, I set focus to
the combo box if the value is "Active".
This is working fine except for one glitch. When I move
from one record to the next in the form using the
navigation keys, and if the cursor happens to be in a
control other than the combo box or the textbox, the
textbox is displayed even if the combo box is "Active".
I think I need to place the same code in some other
control in the form, so that the textbox is displayed/not
displayed irrespective of the control where the cursor is
when I navigate. Any pointers??
Thanks!
-Amit