update tableA
set status = (
SELECT A.STATUS
FROM NSDL_STATUS AS A, NSD AS B
WHERE
A.COMP_CODE=B.COMP_CODE AND
A.DP_ID=B.DP_ID AND
A.BP_ID=B.BP_ID)
where
A.COMP_CODE=B.COMP_CODE AND
A.DP_ID=B.DP_ID AND
A.BP_ID=B.BP_ID;
this is not working
access syntax is different mebbe..
To use a recordset within a recordset in VB:
1. Open Master Table Recordset
RS1.OPEN "SELECT * FROM TABLE A"
2. Loop through the master recordset and for each record either execute an update statement
(i.e CN.EXECUTE "UPDATE TABLE B SET STATUS = " & RS1!STATUS & " WHERE BP_ID = " & RS1!BP_ID & " AND DP_ID = RS1!DP_ID"
or open a new recordset
(i.e. RS2.OPEN "SELECT * FROM TABLE B WHERE BP_ID = " & RS1!BP_ID & " AND DP_ID = RS1!DP_ID"
Loop through RS2 and set RS2!STATUS = RS1!STATUS...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.