Hi,
I am fairly new at VBA so please be nice =)
I am having problems updating a table with a foreign key if I already have a field that matches in the other table.
Please let me explain:
tblA
X (PK)
Y (FK)
Z (FK)
tblB
Y (PK)
Z (PK)
In table A, I already have data populated in Field Z. This field is populated from the original datasource. What I want to do is update tblA so that it contains the corresponding Field Y if tblA.z=tblB.z.
I've built the following SQL statement but it doesn't seem to be working. Please help!
DoCmd.RunSQL "Update tblA Set tblA.y=tblB.y where tblA.z=tblB.z"
I get an error message saying that it's missing something at the end of the statement.
Thanks!
I am fairly new at VBA so please be nice =)
I am having problems updating a table with a foreign key if I already have a field that matches in the other table.
Please let me explain:
tblA
X (PK)
Y (FK)
Z (FK)
tblB
Y (PK)
Z (PK)
In table A, I already have data populated in Field Z. This field is populated from the original datasource. What I want to do is update tblA so that it contains the corresponding Field Y if tblA.z=tblB.z.
I've built the following SQL statement but it doesn't seem to be working. Please help!
DoCmd.RunSQL "Update tblA Set tblA.y=tblB.y where tblA.z=tblB.z"
I get an error message saying that it's missing something at the end of the statement.
Thanks!