enabling next control..

keybearer

Registered User.
Local time
Today, 05:02
Joined
Jul 7, 2003
Messages
41
hi.. a little help please.. on my form theres a textbox named profession.. and the next texbox named rank.. the rank txtbox is disabled..
how do i automatically enable the rank txtbox and set the focus on it when the profession entered is equal to "army officer" and just go to the next txtbox if the value is not..
 
Use the After Update event of the Profession control.

i.e.

Code:
If Me.cboProfession = "Army Officer" Then
    With Me.cboRank
        . Enabled = True
        .SetFocus
    End With
Else
    Me.cboRank.Enabled = False
    Me.NextControl.SetFocus
End If
 
Just a sly suggestion in there that you should use a combo box rather than a textbox to collect professions...
 
hey.. thanks for the help.. about your suggestion, i dont think its possible because sometimes a person may have more than one profession..
anyways.. thanks again...
 
If they can have more than one profession, then your data structure is incorrect. You should NOT be storing multiple values in a single field.
 

Users who are viewing this thread

Back
Top Bottom