Update not working persistently

Freak81

Registered User.
Local time
Today, 14:22
Joined
Nov 30, 2005
Messages
14
Hi all,

I'm trying to use an update query, but somehow, it doesn't store anything in my database. This is my code:

Code:
sql = "UPDATE CONSTRUCTIEF SET ConstructiefScore = " & strGebouwConsScore & " AND ConstructiefCommentaar = '" & strGebouwConsOmschrijving & "' WHERE ConstructiefID = " & strGebouwCons
DoCmd.RunSQL sql

When the execution reaches this peace of code, I actually get the right warning message because he's going to update a table, but when i'm looking in the table afterwards, nothing has been updated.

Anybody got any clue?

Thnx in advance,

Freak
 
Hi -

I think your syntax is not correct. Try replacing the AND with a comma (assuming that you want to update two fields vs. match two fields )

sql = "UPDATE CONSTRUCTIEF SET ConstructiefScore = " & strGebouwConsScore & " , ConstructiefCommentaar = '" & strGebouwConsOmschrijving & "' WHERE ConstructiefID = " & strGebouwCons

DoCmd.RunSQL sql

hth,

- g
 
Hey man, this helped, thanks a lot!
 

Users who are viewing this thread

Back
Top Bottom