Hi,
I'm new to access. I'm trying to update a tables. Below is the VBA Code.
But nothing is working. Can somebody help me to write the code.
Please note that there are two tables. One is CUSTOMERS and the other is SALES. When I click on the button, I want the field CustomersStatus be updated to "Closed" where CustomersStatus = 'Invoiced' the table Customers and where CustomerID in table Customers = the field Invoice_ID in table Sales. I know that this must be easy. Its just that I'm new and don't know how to proceed.
I'm new to access. I'm trying to update a tables. Below is the VBA Code.
Code:
Private Sub cmdUpdateSales_Click() DoCmd.RunSQL "UPDATE Customers SET Customers.CustomersStatus = 'Closed'" & _ "Where (Customers.CustomersStatus) = 'Invoiced' and (Customers.CustomerID) = " & Me.Invoice_ID.Value & "" End Sub
Please note that there are two tables. One is CUSTOMERS and the other is SALES. When I click on the button, I want the field CustomersStatus be updated to "Closed" where CustomersStatus = 'Invoiced' the table Customers and where CustomerID in table Customers = the field Invoice_ID in table Sales. I know that this must be easy. Its just that I'm new and don't know how to proceed.
Comment