ardy
Registered User.
- Local time
- Today, 00:42
- Joined
- Sep 24, 2012
- Messages
- 98
Hello All:
In the code below I am creating a record with the INSET INTO statement and then Updating with additional info in various fields. it is not working the way I thought it would, so I am trying to create the record in it's entirety ……
I am running to syntax problems when I try to USE the INSERT INTO to create the record with all the info in one statement……
I am Getting this error:
What Am I missing..... :banghead:
Ardy
In the code below I am creating a record with the INSET INTO statement and then Updating with additional info in various fields. it is not working the way I thought it would, so I am trying to create the record in it's entirety ……
Code:
SQL_Grade_GUSD_ID = "INSERT INTO Grades (GUSD_Student_ID) VALUES (" & Me.GUSD_Student_ID & ")"
SQLM1_1_ELA = "UPDATE Grades SET Grades.Subject = ""BM1(ELA)"""
SQLM1_2_ELA = "UPDATE Grades SET Grades.Type = ""Exam"""
SQLM1_3_ELA = "UPDATE Grades SET Grades.Score = ""0"""
SQLM1_4_ELA = "UPDATE Grades SET Grades.Nam = ""GUSD BM-1"""
DoCmd.RunSQL SQL
DoCmd.RunSQL SQL_Grade_GUSD_ID
DoCmd.RunSQL SQLM1_1_ELA
DoCmd.RunSQL SQLM1_2_ELA
DoCmd.RunSQL SQLM1_3_ELA
DoCmd.RunSQL SQLM1_4_ELA
Debug.Print SQL, SQL_Grade_GUSD_ID
Code:
SQLM1_1_ELA = "INSERT INTO Grades ( GUSD_Student_ID, Subject, Type, Score, Nam ) " & _
"SELECT (" & Me.GUSD_Student_ID & ")"" AS GUSD_Student_ID, ""BM2(ELA)"" AS Subject, " & _
"""Exam"" AS Type, ""0"" AS Score, ""GUSD BM-1"" AS Nam " & _
"FROM Grades"
Syntax error (missing operator) in query expression ‘(12345)” AS GUSD_STUDENT_ID,
“BM2(ELA)” As Subject, “Exam” AS Type, “0” As Score, “GUSD BM-1” AS Nam From Grades’
What Am I missing..... :banghead:
Ardy