Problem with UPDATE function

kwokv616

Registered User.
Local time
Today, 02:54
Joined
Nov 10, 2008
Messages
46
Is this not possible?

MySQL = "UPDATE Table1 SET Column1 = Pol.Column1;"
DoCmd.RunSQL MySQL

If not, how can I do it?

Thank you!!
 
Yes it is possible, but what is "Pol" ??
 
Sorry forgot to rename...
Pol is another table.

It should be sth like this:

MySQL = "UPDATE Table1 SET Column1 = Table2.Column1;"
DoCmd.RunSQL MySQL
 
Is this not possible?

MySQL = "UPDATE Table1 SET Column1 = Pol.Column1;"
DoCmd.RunSQL MySQL

If not, how can I do it?

Thank you!!


I can only assume with the information given that pol is another table that you have the updated values stored in.

If that is not the case, please ignore the rest of my comments.

If it is:
  • You will need to modify the Update Statemnent to include a Join between Table1 and the Table pol. Something like the following should be on the right track:
Code:
UPDATE Table1[COLOR=blue][B] INNER JOIN Pol[/B][/COLOR] 
ON [COLOR=red][B]Table1.Table1JoinKey = Pol.PolJoinKey[/B][/COLOR]
SET Column1 = Pol.Column1;

BLUE Code needs to be added.
RED Code needs to be added, but has not been defined.
 

Users who are viewing this thread

Back
Top Bottom