I have 2 tables as shown below. I need to update the [incomming letter contractor] field of table [ASBUILT_LIST] with value of [TRANSMITTAL] of table [tblTransmittalls]
I have used the following update query
UPDATE ASBUILT_LIST INNER JOIN tblTransmittalls
ON ASBUILT_LIST.DOC=tblTransmittalls.DocumentNo
SET ASBUILT_LIST.[incomming letter contractor] = [tblTransmittalls]![TRANSMITTAL]
WHERE ((tblTransmittalls.PurposeofIssue)="FIN"));
Now when there is not any match for [DocumentNo] field (related between 2 tables) I need to update [incomming letter contractor] to NULL
value.
SET ASBUILT_LIST.[incomming letter contractor] = Null
and when there is a match it is updated like before:
SET ASBUILT_LIST.[incomming letter contractor] = [tblTransmittalls]![TRANSMITTAL]
The tables are:
TABLE: ASBUILT_LIST
doc incomming letter contractor
------------------ ---------------------------
doc-1000 L-0001
doc-2000 L-0002
TABLE: tblTransmittalls
DocumentNo TRANSMITTAL PurposeofIssue
----------------- --------------- --------------
DOC-1000 T-0001 FIN
DOC-3000 T-0500 FIN
DOC-4000 T-0600 IFI
DOC-2000 T-0800 IFI
I need an updated ASBUILT_LIST table so after running update query it should be like this:
doc incomming letter contractor
------------- ---------------------------
doc-1000 T-0001
doc-2000 null