Simple Code: or should be!! Newby Help Please!

Richard Green

New member
Local time
Today, 12:27
Joined
Oct 25, 2007
Messages
5
Can anyone help please. I have several controls on a Main Form. One of them is a combo box named "Designation". It calls from a table the employment status of a person. On my form when the word "RESIGNED" is displayed in the combo box, I want a label to become visible stating "This Person Has Resigned".I used this code in the Form Properties/On Current.

Private Sub Form_Current()

Me![ImageFrame].Picture = Me![ImagePath](This returns a photo)

If Me.Designation.Value = "RESIGNED" Then
Label101.Visible = True
Else
Label101.Visible = False
End If
End Sub
I don't get any error message, but I don't get the label either. Can someone help please?
 
need to add "me.refresh" at the last line. Can you try?
 
Actually, put this code in the combo box's After Update too so that it updates when the combo is changed. The On Current event only fires when you move between records.
 
Are you sure that your combo is returning a string value or maybe it is returning an ID number which then wouldn't be equal to "Resigned"

In the After Update event of the combo put this to see what it is returning:

Msgbox Me.YourComboBoxNameHere
 
are you using "RESIGNED" when design? Not the ID, right?!!
 
I suggest you try to create a variable and store the value of Me.Designation.Value, then use MsgBox to print it out. Let see what is the value it is storing first.
 

Users who are viewing this thread

Back
Top Bottom