I have created a query which updates a customer ID in an order table where the customer's first name and surname are in the customer database.
UPDATE tblOrder SET CustomerID = (SELECT CustomerID FROM tblCustomer WHERE First_Name ='Fname' AND Surname='Sname') WHERE EXISTS (SELECT CustomerID FROM tblCustomer WHERE First_Name ='Fname' AND Surname='Sname')
The reason I have posted this in MS Access is that I aim to use it for VB.Net though I cannot seem to get this query to work.
EDIT: The update values 'Fname' AND 'Sname' are basically place holders as the actual values will be variables.
This post has been edited by Jezzabeanz: 08 June 2012 - 12:47 PM