Log in

View Full Version : Fay: Access_2010_Combining_an_Insert_Into_statement_with_Select.



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

SamT
09-26-2014, 07:49 PM
Fay,

Thank you for exposing a problem that we have with some thread titles. We are now looking into what we can do to prevent this from happening again.

What happened??? It appears that using some SQL terms in thread titles will cause our server to reject any request for that thread raising a "406" error. In this instance, I replaced all spaces in the original title with underscores. I imaging that merely misspelling SQL Keywords or prefixing them with an underscore will be enough to prevent the issue while we check into the problem.

Please forgive us.

Fay
09-27-2014, 08:07 PM
Thank you. Sorry for issue.