Hi,
I have a table with 2 fields in it, Name and Class, that I would like to insert into a main table, into 2 seperate fields , [Employee_Name] and [Trade_W/C_Code] via a form by selecting the Name field in a combo box displaying both Name and Class.
I entered the following code:
Private Sub Combo49_AfterUpdate()
Name = DLookup("[Name]", "tblName", "[Employee_Name]='" & MyCombo & "'")
Class = DLookup("[Class]", "tblName", "[Trade_W/C_Code]='" & MyCombo & "'")
End Sub
It cannot find my table named Name so I can't tell if it's working or not.
Any assistance would be appreciated.
RJ
I have a table with 2 fields in it, Name and Class, that I would like to insert into a main table, into 2 seperate fields , [Employee_Name] and [Trade_W/C_Code] via a form by selecting the Name field in a combo box displaying both Name and Class.
I entered the following code:
Private Sub Combo49_AfterUpdate()
Name = DLookup("[Name]", "tblName", "[Employee_Name]='" & MyCombo & "'")
Class = DLookup("[Class]", "tblName", "[Trade_W/C_Code]='" & MyCombo & "'")
End Sub
It cannot find my table named Name so I can't tell if it's working or not.
Any assistance would be appreciated.
RJ