Hello,
I have the following code producing a run time error. It actually works and and gives me the proper output but it also gives me a run time error '13' for some reason.
The purpose of this code is when a user chooses a Family Name from a combo box, a field called txtFamilyID is populated with a number associated with the Family Name chosen.
Below is the snippet of the code within the "Hours Form". The bolded code gets highlighted when the form is executed.
Private Sub HoursForm_Initialize()
cbFamilyName.List = Sheets("Names").Range("A1:A200").Value
End Sub
Private Sub cbFamilyName_Change()
txtFamilyID.Text = Application.VLookup(Me.cbFamilyName.Value, Sheets("Names").Range("A1:B200"), 2, 0)
End Sub
I have the following code producing a run time error. It actually works and and gives me the proper output but it also gives me a run time error '13' for some reason.
The purpose of this code is when a user chooses a Family Name from a combo box, a field called txtFamilyID is populated with a number associated with the Family Name chosen.
Below is the snippet of the code within the "Hours Form". The bolded code gets highlighted when the form is executed.
Private Sub HoursForm_Initialize()
cbFamilyName.List = Sheets("Names").Range("A1:A200").Value
End Sub
Private Sub cbFamilyName_Change()
txtFamilyID.Text = Application.VLookup(Me.cbFamilyName.Value, Sheets("Names").Range("A1:B200"), 2, 0)
End Sub