Insert INTO statement

S

Steve in S.F.

I inherited some code from someone else and need to make a small
modification, but I can't seem to get the synatax correct.

Here is the original code:

DoCmd.RunSQL "INSERT INTO tblProjectArtifacts ( Artifact, ProjectID )" & _
" SELECT tbl2005JobAids.Artifacts," & Me.txtUniqueProjectID & " AS x1" & _
" FROM tbl2005JobAids;"

What's happened is that we've added one more field in the table
"tbl2005JobAids" . The new field is called "PhaseGate". I simply want to
include the PhaseGate field in the new records that are added to
tblProjectArtifacts.
Can anyone supply the correct modification?

Much appreciate any help!

Steve
 
D

Douglas J. Steele

DoCmd.RunSQL "INSERT INTO tblProjectArtifacts ( Artifact, ProjectID.
PhaseGate )" & _
" SELECT tbl2005JobAids.Artifacts," & Me.txtUniqueProjectID & " AS x1,"
& _
" PhaseGate FROM tbl2005JobAids;"
 
S

Steve in S.F.

Thanks so much for the solution (although I think you had a typo and there
should be a comma rather than a period between ProjectID and PhaseGate).

Your help greatly appreciated! :)
 
Top