Hi,
I have a main form which contains an employee ID text box the user enters. Then from a combo box
My dilemma is getting the subform info to save to a table named
I have an INSERT INTO SQL statement but its not working:
I have a main form which contains an employee ID text box the user enters. Then from a combo box
CboDept the user chooses dept which populates another combo box where the user chooses job title. CboJob_Title There is a subform (Class_Catalog subform)(set as continuouse) that is linked to the main form (Emp_New) by job title. From the job title the subform populates Class_ID. There may be anywhere from 0 to 15 lines populated based on selection in main form.My dilemma is getting the subform info to save to a table named
Classes_taken. Each record is comprised of Emp_ID and Class_ID. At the same time I need the main form to save its record to Emp table.I have an INSERT INTO SQL statement but its not working:
Code:
Private Sub CmdSave_Click()
Dim mySQL As String
mySQL = "INSERT INTO Classes_taken([Emp_ID],[Class_ID])VALUES(" & Forms![Class_Catalog subform]![TxtEmp] & "," & Forms![Class_Catalog subform]![TxtCID] & ");"
Debug.Print mySQL
DoCmd.RunSQL mySQL
End Sub
Comment