deanlee17
asked on
SQL insert syntax
Hi Experts,
Im trying to add the following code to the after update command of a dropdown menu.
DoCmd.RunSQL "INSERT INTO PSNForFilter([PSN]) VALUES([Student reference]) FROM UNITE_MIS_ENROL WHERE [Class reference] = '" & Me.[course_dropdown] & "'"
The run-time error I get is 3137 missing semicolon (;) at end of SQL statement. If i put the semicolon in there then it gives a compile error?
Many Thanks,
Dean
Im trying to add the following code to the after update command of a dropdown menu.
DoCmd.RunSQL "INSERT INTO PSNForFilter([PSN]) VALUES([Student reference]) FROM UNITE_MIS_ENROL WHERE [Class reference] = '" & Me.[course_dropdown] & "'"
The run-time error I get is 3137 missing semicolon (;) at end of SQL statement. If i put the semicolon in there then it gives a compile error?
Many Thanks,
Dean
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much Angel, that worked perfectly.
Santos: I didnt try your solution because angelll suggested VALUES was not required. But thank you for taking the time to reply.
Santos: I didnt try your solution because angelll suggested VALUES was not required. But thank you for taking the time to reply.
is this giving you compile error???