i'm new at sql statements in access, particularly nested ones. One trying to run an append query based upon a checkbox value. Here's what I want to accomplish. If the box is NOT checked, then I want to enter the value for CustID (from TblTransactions) into a certain field "Owner" (belonging to TblAddress). If the box IS checked, I want to erase the contents of field "Owner", but ONLY if the value of Owner is NOT equal to the value of CustID for the latest transaction (in which the box is or isn't checked). Mostly the query works, but the nested part of it does not work. For instance, if the box is CHECKED, and the corresponding "Owner" field IS EQUAL to CustID for the latest transaction, then it erases the value in the Owner field anyway, though it shouldn't. Maybe if I attach my code this will make more sense. Thanks.
UPDATE tblAddress, tblTransactions
SET tblAddress.Owner =
IIf
(([TblTransactions].[Seller]=1),
IIf
(([tblAddress].[Owner])=([tblTransactions].[CustID]),Null),
([Forms]![CustTrans]![CustomerID]))
WHERE
((([tblTransactions].[TransactionID])=
DMax("[TransactionID]","TblTransactions")
AND(([tblAddress].[ID])=[TblTransactions].[AddressID]));
UPDATE tblAddress, tblTransactions
SET tblAddress.Owner =
IIf
(([TblTransactions].[Seller]=1),
IIf
(([tblAddress].[Owner])=([tblTransactions].[CustID]),Null),
([Forms]![CustTrans]![CustomerID]))
WHERE
((([tblTransactions].[TransactionID])=
DMax("[TransactionID]","TblTransactions")
AND(([tblAddress].[ID])=[TblTransactions].[AddressID]));