Hello,
I have to aapologize in adavance. If this is repeat topic- I am sorry- but I haven't been able to find the answer, most likely because I am using the wrong search terms. I am not very adept at creating forms and the form terminology is beyond me.
Here is the problem that I need help with:
I have a Transactions table which holds vendor name, invoice number, and amount.
I have an InvoiceDetails table which holds the details of the invoices.
The two tables have a relationship defined on InvoiceNum.
I set up an Invoices form based on 'select vendor, invoicenum, amount from transactions'. The records in this main form are updatable, as I expect.
I also set up a subform called InvoiceDetails and linked it to the main Invoices form through Vendor Name and InvoiceNum.
Ok, I can scroll through the vendors and the related records in the child form come up.
Now, I want the user to be able to edit the invoice numbers in the main form. I can do that since it's updatable.
What I cannot figure out is how to update all the related records in InvoiceDetails with the updated invoice number. Is this even possible? Or does the user have to go line by line in the InvoiceDetails subform and change the invoice numbers manually?
If this is possible, which events of the InvoiceNum control on the mainform do I have to use? I looked at posts about before and after update events, but I cannot figure out how to reference both the before-update value and the after-update value of the InvoiceNum field so that I can run an update query on the InvoiceDetails table to match what the user has just put into the InvoiceNum field of the main form.
Thank you! I really appreciate any insight or guidance anyone has to offer.
I have to aapologize in adavance. If this is repeat topic- I am sorry- but I haven't been able to find the answer, most likely because I am using the wrong search terms. I am not very adept at creating forms and the form terminology is beyond me.
Here is the problem that I need help with:
I have a Transactions table which holds vendor name, invoice number, and amount.
I have an InvoiceDetails table which holds the details of the invoices.
The two tables have a relationship defined on InvoiceNum.
I set up an Invoices form based on 'select vendor, invoicenum, amount from transactions'. The records in this main form are updatable, as I expect.
I also set up a subform called InvoiceDetails and linked it to the main Invoices form through Vendor Name and InvoiceNum.
Ok, I can scroll through the vendors and the related records in the child form come up.
Now, I want the user to be able to edit the invoice numbers in the main form. I can do that since it's updatable.
What I cannot figure out is how to update all the related records in InvoiceDetails with the updated invoice number. Is this even possible? Or does the user have to go line by line in the InvoiceDetails subform and change the invoice numbers manually?
If this is possible, which events of the InvoiceNum control on the mainform do I have to use? I looked at posts about before and after update events, but I cannot figure out how to reference both the before-update value and the after-update value of the InvoiceNum field so that I can run an update query on the InvoiceDetails table to match what the user has just put into the InvoiceNum field of the main form.
Thank you! I really appreciate any insight or guidance anyone has to offer.
Last edited: