I need help with this simple SQL statement

G

glen.welsh

I am a SQL novice and I need help with the following statement:

strSQL = "INSERT INTO tbl_Del_Prop (PERMANENT_DELETION,
PROPOSED_DELETION)"
strSQL = strSQL & " IN '" & vntDatabasePath & "' "
strSQL = strSQL & " VALUES (-1, 0)"
strSQL = strSQL & " WHERE (([ID]=" & Me!ID & "));"

I am trying to update Permanent and Proposed in a back end table when a
check box is selected on the front end form. I get an error that my
SQL string is missing a semicolon but I can't figure out why. Please
help.
 
A

Amy Blankenship

Insert clauses don't use a WHERE clause because the record doesn't exist.

HTH;

Amy
 
G

Glen

Thanks Amy. I didn't know. If an INSERT clause doesn't use WHERE, how
do you specify which record to change in the table?
 
G

Glen

I explicitly said I was a novice. ;-) I see now how UPDATE can work
for me. Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top