L
landeye
I have two tables I am trying to insert data into. Both tables have an
Autonumber field (which I omitted from the INSERT INTO statement). I have
been successful in coding one of the forms to allow the INSERT INTO, but for
some reason I keep getting an "Invalid SQL Statement" on the other. I am
using the exact same syntax in both statements but the field types are
slightly different in the two tables.
Here's the syntax that works:
sqlPNote = "INSERT INTO DQPNote ( [NoteCo], [NoteProject], [NoteDate],
[NoteTaker], [Note], [Complete] ) " & _
" VALUES('" & tmpPNoteCo & "', '" & tmpPNoteProject & "', '" & tmpPNoteDate
& "', '" & tmpPNoteTaker & "', '" & tmpPNote & "', '" & tmpPNoteComplete &
"')"
.......NoteCo, NoteProject, NoteTaker, Note are all strings
.......NoteDate is a Datefield
.......Complete is a Boolean
Here's the syntax that doesn't:
sqlINote = "INSERT INTO DQINote ( [ARIDx], [NoteDate], [NoteTaker], [Note],
[Complete] ) " & _
" VALUES(" & tmpARIDx & ", '" & tmpINoteDate & "', '" & tmpINoteTaker & "',
'" & tmpINote & "', '" & tmpINoteComplete & "')"
.......ARIDx is a Number
.......NoteDate is a Datefield
.......NoteTaker, Note are Strings
.......Complete is Boolean
I appreciate any help. Thanks.
Autonumber field (which I omitted from the INSERT INTO statement). I have
been successful in coding one of the forms to allow the INSERT INTO, but for
some reason I keep getting an "Invalid SQL Statement" on the other. I am
using the exact same syntax in both statements but the field types are
slightly different in the two tables.
Here's the syntax that works:
sqlPNote = "INSERT INTO DQPNote ( [NoteCo], [NoteProject], [NoteDate],
[NoteTaker], [Note], [Complete] ) " & _
" VALUES('" & tmpPNoteCo & "', '" & tmpPNoteProject & "', '" & tmpPNoteDate
& "', '" & tmpPNoteTaker & "', '" & tmpPNote & "', '" & tmpPNoteComplete &
"')"
.......NoteCo, NoteProject, NoteTaker, Note are all strings
.......NoteDate is a Datefield
.......Complete is a Boolean
Here's the syntax that doesn't:
sqlINote = "INSERT INTO DQINote ( [ARIDx], [NoteDate], [NoteTaker], [Note],
[Complete] ) " & _
" VALUES(" & tmpARIDx & ", '" & tmpINoteDate & "', '" & tmpINoteTaker & "',
'" & tmpINote & "', '" & tmpINoteComplete & "')"
.......ARIDx is a Number
.......NoteDate is a Datefield
.......NoteTaker, Note are Strings
.......Complete is Boolean
I appreciate any help. Thanks.