Hey,
I'm having a problem running an UPDATE query using an expression as the value to update to.
I have 2 tables called "Invoices" and "Orders". Both "Invoices" and "Orders" have a field called InvoiceID with the primary key and foreign key respectively. I have a control "Create invoice" which when clicked creates a new record in the "Invoices" table with the "InvoiceID" being auto incremented. I have a query "InvoiceIDMaxQ" which finds the maximum of the values in "InvoiceID" in "Invoices" which is aliased "InvoiceIDMax". I have a query "OrdersToInvoice" which finds all the "InvoiceID" field records in "Orders" with the value of "1" (that is the default value I have set for that field when a new record is created). I have an UPDATE query which uses "OrdersToInvoice" query and SET's the "InvoiceID" value to [InvoiceIDMaxQ].[InvoiceIDMax].
This does not work and Access asks for a parameter using a parameter popup. Can anyone tell me what I can do to get this to work or have any suggestions on a better way to go about creating Invoices.
Thanks.
I'm having a problem running an UPDATE query using an expression as the value to update to.
I have 2 tables called "Invoices" and "Orders". Both "Invoices" and "Orders" have a field called InvoiceID with the primary key and foreign key respectively. I have a control "Create invoice" which when clicked creates a new record in the "Invoices" table with the "InvoiceID" being auto incremented. I have a query "InvoiceIDMaxQ" which finds the maximum of the values in "InvoiceID" in "Invoices" which is aliased "InvoiceIDMax". I have a query "OrdersToInvoice" which finds all the "InvoiceID" field records in "Orders" with the value of "1" (that is the default value I have set for that field when a new record is created). I have an UPDATE query which uses "OrdersToInvoice" query and SET's the "InvoiceID" value to [InvoiceIDMaxQ].[InvoiceIDMax].
This does not work and Access asks for a parameter using a parameter popup. Can anyone tell me what I can do to get this to work or have any suggestions on a better way to go about creating Invoices.
Thanks.