On a form I've got a query that uses 2 tables linked by a order ID, Payment and Order. The form is meant to add a payment into the payment table and then set a field 'HasPayment' in the order table to true. On the form_load() I've had do the following:
DoCmd.GoToRecord , , acNewRec
So that when the form is used it automatically adds a new payment row. However because of the query it also adds a new record to the order table. This means that it sets HasPayment in this new row to True. I need it to look at the order that the payment is linked to by order ID and set HasPayment for that order. If you can help I'd be most appreciative. Cheers R
I also tried the following:
CurrentDb.Execute = "UPDATE Order Set HasPayment = True WHERE OrderID = " & OrderID.Value & ";"
However, when I try and run I get the error 'Argument not optional'
Help!!!
DoCmd.GoToRecord , , acNewRec
So that when the form is used it automatically adds a new payment row. However because of the query it also adds a new record to the order table. This means that it sets HasPayment in this new row to True. I need it to look at the order that the payment is linked to by order ID and set HasPayment for that order. If you can help I'd be most appreciative. Cheers R
I also tried the following:
CurrentDb.Execute = "UPDATE Order Set HasPayment = True WHERE OrderID = " & OrderID.Value & ";"
However, when I try and run I get the error 'Argument not optional'
Help!!!