Here I go again bugging you nice people with my problems. In any case, on a form I have:
a.) 3 frames - user Info, Travel, and Training (with multiple labels and text fields on each).
b.) EntryType comboBox (with Travel, Training, and Both)
My goal is to allow the user to enter information based on what they choose on on the cboEntryType. Example, if user picks Travel on the cboEntryType then Travel frame will be enable and Training frame will be disabled -- Travel & Training frames are disabled by default.
But my code does not work. With a new record, I have to pick the EntryType and save it first and then navigate back and forth before it enables the correct frame.
-------------------
Private Sub cboEntryType_Change()
Dim a, b, c, d As String
Dim EntryType As String
a = "Travel"
b = "Training"
c = "Travel & Training"
d = ""
EntryType = cboEntryType.Text
Select Case EntryType
Case a
Account.Text = "21xx - Travel"
Frame2.Enabled = True
'Frame3.Enabled = False
Case b
Account.Text = ""
Frame2.Enabled = False
Frame3.Enabled = True
Case c
Account.Text = "21xx - Travel"
Frame2.Enabled = True
Frame3.Enabled = True
Case d
Account.Text = ""
Frame2.Enabled = False
Frame3.Enabled = False
End Select
End Sub
-----------
What I'm doing wrong? I've also tried using If... then...Else; If...Elseif statements and I'm having the same problems. I even put the above code in the Private Sub Form_Load() but I got the same result.
Thanks in advance
a.) 3 frames - user Info, Travel, and Training (with multiple labels and text fields on each).
b.) EntryType comboBox (with Travel, Training, and Both)
My goal is to allow the user to enter information based on what they choose on on the cboEntryType. Example, if user picks Travel on the cboEntryType then Travel frame will be enable and Training frame will be disabled -- Travel & Training frames are disabled by default.
But my code does not work. With a new record, I have to pick the EntryType and save it first and then navigate back and forth before it enables the correct frame.
-------------------
Private Sub cboEntryType_Change()
Dim a, b, c, d As String
Dim EntryType As String
a = "Travel"
b = "Training"
c = "Travel & Training"
d = ""
EntryType = cboEntryType.Text
Select Case EntryType
Case a
Account.Text = "21xx - Travel"
Frame2.Enabled = True
'Frame3.Enabled = False
Case b
Account.Text = ""
Frame2.Enabled = False
Frame3.Enabled = True
Case c
Account.Text = "21xx - Travel"
Frame2.Enabled = True
Frame3.Enabled = True
Case d
Account.Text = ""
Frame2.Enabled = False
Frame3.Enabled = False
End Select
End Sub
-----------
What I'm doing wrong? I've also tried using If... then...Else; If...Elseif statements and I'm having the same problems. I even put the above code in the Private Sub Form_Load() but I got the same result.
Thanks in advance