Fay
09-26-2014, 10:14 AM
Insert Into with select statement in Access 2010
I have a form "frm_CL_Sch_SelectComp" that has a subform called "frm_CL_Sch_SF_SelectComp". The main form has a control called txtClassID that is bound to the ClassID field.
On the subform there are 15 check boxes that I have an SQL Insert Into statements that obviously insert records into a table. The code is:
If Me.ckEvaluation = True Then
DoCmd.RunSQL "INSERT INTO tbl_CL_Sch_ClassSchComp ([Event], [Length], [CountsAsCE], [AlternateTitle])" & _
"VALUES ('Evaluation', 5, True, 'Evaluation'); "
End If
My problem is that I need to get the ClassID into the table for each record. I think I need a Select From statement. But, I have been unable to figure out how to make that happen with the Insert Into statement. I would really appreciate any help to directing me in the right direction.
Thank you.
Fay
I have a form "frm_CL_Sch_SelectComp" that has a subform called "frm_CL_Sch_SF_SelectComp". The main form has a control called txtClassID that is bound to the ClassID field.
On the subform there are 15 check boxes that I have an SQL Insert Into statements that obviously insert records into a table. The code is:
If Me.ckEvaluation = True Then
DoCmd.RunSQL "INSERT INTO tbl_CL_Sch_ClassSchComp ([Event], [Length], [CountsAsCE], [AlternateTitle])" & _
"VALUES ('Evaluation', 5, True, 'Evaluation'); "
End If
My problem is that I need to get the ClassID into the table for each record. I think I need a Select From statement. But, I have been unable to figure out how to make that happen with the Insert Into statement. I would really appreciate any help to directing me in the right direction.
Thank you.
Fay