L
Lee
Hi guys,
Can you see what I've done wrong in the code below? I'm
trying to create an 'insert into' query in sql and then
run it but I keep getting the above error. Do you know
why? Here's the main code:
Dim db As Database
Dim qdf As QueryDef
stSQL = "INSERT INTO tbl_LettersInsp (InspectorID, ToID,
FromID, LetterDate, LetterNotes)"
stSQL = stSQL & "VALUES (Forms!frm_LettersInspectors!
txtID, '2', '3', Now(), 'NEW TEST');"
Set qdf = db.CreateQueryDef("qry_AddLetter", stSQL)
DoCmd.OpenQuery qdf.Name
Any help or ideas would be greatly appreciated!
Regards,
Lee
Can you see what I've done wrong in the code below? I'm
trying to create an 'insert into' query in sql and then
run it but I keep getting the above error. Do you know
why? Here's the main code:
Dim db As Database
Dim qdf As QueryDef
stSQL = "INSERT INTO tbl_LettersInsp (InspectorID, ToID,
FromID, LetterDate, LetterNotes)"
stSQL = stSQL & "VALUES (Forms!frm_LettersInspectors!
txtID, '2', '3', Now(), 'NEW TEST');"
Set qdf = db.CreateQueryDef("qry_AddLetter", stSQL)
DoCmd.OpenQuery qdf.Name
Any help or ideas would be greatly appreciated!
Regards,
Lee