sql update syntax multiple tables





Where uid is their userid then it will delete all related records in both tables (so all messages to and from them). The problem is this will also delete messages that were sent to them AND other people. Is there anyway to only delete records if the associated record in TMessageRecipients is unique (ie there isn't another record in there with the same MessageID)?

If that's not entirely clear then do ask me to clarify anything! Thanks so much for your help, i think there must be a way to do it, but i'm not sure how!

Dave Hi Robert
I am not quite following you, so in my master form (Contact Details)the query connected to the embeded macro should include INSERT INTO for both tables?
I will explain the structure of my tables.
Local tables:
Contacts (PK=ID)
Actions_local(PK=AID, FK=ID)

Online SQL Server tables:
dbo_Contacts (PK=ID)
dbo_Actions_local(PK=AID, FK=ID)

Masterform (Contact Details)
Subform in Contact Details (frmActions)

I am using this query to update the Contacts table in my Contact Details form:
INSERT INTO dbo_Contacts ( ID, FirstName, LastName, Company, EmailAddress)
SELECT Contacts.ID, Contacts.FirstName, Contacts.LastName, Contacts.Company, Contacts.EmailAddress,
FROM Contacts
WHERE (((Contacts.ID)=[Forms]![Contact Details].[ID]));

Currently I can update Contact Details for the local and online Contacts and dbo_Contacts. Left is the fields in the subform frmActions to update the dbo_Actions_local table from the local Actions_local table.
These are the fields I need to update:
INSERT INTO dbo_Actions_local ( AID, ActionDate, Stock, Amount, Cost, Depot, FundBankAgent, ID )
SELECT Actions_local.AID, Actions_local.ActionDate, Actions_local.Stock, Actions_local.Amount, Actions_local.Cost, Actions_local.Depot, Actions_local.FundBankAgent, Actions_local.ID
FROM Actions_local;

So how can i pull these both actions togather, putting both of my INSERT INTO in my [Contact Details]? From the above information how would the SQL query synthax look like?

-Sohail