G
Guest
Hello,
I have some code that is based on the user's choice from a combo box field
('sexcode'), whose values are derived from a Value List
("f";"female";"m";"male"). I have code to gray out the next control
('Frame9surg_sterl') if the user chooses "male", but to keep it Enabled if
"female" is chosen. What happens is that 'Frame9surg_sterl' is grayed out
regardless of what the user chooses. I have this working elsewhere in my
database, but this is the first time I'm attempting to do this using a combo
box populated by an alphanumeric value from a Value List instead of a number.
What is my code (below) missing here?
Private Sub sexcode_AfterUpdate()
Dim sexcode As String
If sexcode = f Then
Me!Frame9surg_sterl.Enabled = True
Else
Me!Frame9surg_sterl.Enabled = False
End If
End Sub
I have some code that is based on the user's choice from a combo box field
('sexcode'), whose values are derived from a Value List
("f";"female";"m";"male"). I have code to gray out the next control
('Frame9surg_sterl') if the user chooses "male", but to keep it Enabled if
"female" is chosen. What happens is that 'Frame9surg_sterl' is grayed out
regardless of what the user chooses. I have this working elsewhere in my
database, but this is the first time I'm attempting to do this using a combo
box populated by an alphanumeric value from a Value List instead of a number.
What is my code (below) missing here?
Private Sub sexcode_AfterUpdate()
Dim sexcode As String
If sexcode = f Then
Me!Frame9surg_sterl.Enabled = True
Else
Me!Frame9surg_sterl.Enabled = False
End If
End Sub