INSERT SQL
Does anybody know a good reference to Access SQL? Preferably online.
I'm getting an error message Syntax Error in INSERT INTO Statement.
Here's the code: it works down to the RunSQL statement. Probably I'm overlooking something, but can't find a reference.
Note: there's no line break after Startdate,, the forum just shortened the line.
-------------------------------
Private Sub cmdAddRecord1_Click()
On Error GoTo Err_cmdAddRecord1_Click
Dim txtSQLAdd As String
txtSQLAdd = "INSERT INTO Registration ShortName, StartDate, Email, First, Last " & _
"VALUES (lstShortNameS, lstStartDateS, txtEmailS, txtFirstS, txtLastS);"
txtFirstS = Forms![Update Registrations].txtFirst
txtLastS = Forms![Update Registrations].txtLast
txtEmailS = Forms![Update Registrations].txtEmail
txtGo = MsgBox("OK to Update?", 1, "Is All Data Correct")
If txtGo = vbOK Then
txtAction = "Update"
DoCmd.RunSQL txtSQLAdd
Else
txtAction = "Cancel"
Me.Undo
End If
|