SQL Update not working

exaccess

Registered User.
Local time
Today, 07:18
Joined
Apr 21, 2013
Messages
287
Code:
DoCmd.RunSQL "UPDATE [" & dest & "] SET [Association] '=' [" & Associate & "];"
This SQL statement causes trouble. I tried many variations but none worked. Here the dest is a variable containing the tablename, Association is the name of a column of dest and Associate is a variable containing the data to be stored in all table records. Please help.
 
Code:
DoCmd.RunSQL "UPDATE [" & dest & "] SET [Association] '=' [" & Associate & "];"
This SQL statement causes trouble.
If Association is text then:
"UPDATE [" & dest & "] SET [Association] ='" & Associate & "'"
If number then:
"UPDATE [" & dest & "] SET [Association] =" & Associate & "
 
If Association is text then:
"UPDATE [" & dest & "] SET [Association] ='" & Associate & "'"
If number then:
"UPDATE [" & dest & "] SET [Association] =" & Associate & "

Works like charm, thank you
 
You DO realize that your UPDATE updated EVERY RECORD in the destination? You have no WHERE clause so it is an unconstrained update.

If that is what you wanted, or if you simplified it for discussion, then no problem.
 
Yes that is what I wanted. This table is not normalized. It is an old aplication.
 

Users who are viewing this thread

Back
Top Bottom