Insert INTO statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
DoCmd.RunSQL "INSERT INTO tblProjectArtifacts ( Artifact, ProjectID.
PhaseGate )" & _
" SELECT tbl2005JobAids.Artifacts," & Me.txtUniqueProjectID & " AS x1,"
& _
" PhaseGate FROM tbl2005JobAids;"
 
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! :)
 
Back
Top