Update a Subform from Form on AfterUpdate Event

B

Brook

Good Day All,

I have a frminvoices with field "invoicenumber" and frminvoicedetails
Subform with the same field name "invoicenumber", after the invoice number is
updated on my Main form, I would like the field updated in my invoicesubform.

any suggestions/tips?

thanks,

Brook
 
A

Allan Murphy

Brook

On the Change or After Update event of the "invoicenumber" on your main
form try this


DoCmd.Requery "sfrm"

where sfrm is the name of your sub-form

HTH
Allan Murphy
Email: (e-mail address removed)
 
S

Steve Schapel

Brook,

Is this invoicenumber field the basis of the relationship between your
Invoice and InvoiceDetails tables? What do you mean about the "invoice
number is updated on my Main form"? Do you mean moving to another or
new invoice record on the main form? Or do you mean the invoicenumber
of an existing invoice is changed? The first scenario should be handled
automatically for you via the correct setting of the Link Master Fields
and Link Child Fields properties of the subform. The second scenario
can be managed by defining a relationship between the tables with
Cascade Update enforced. If I have missed the boat here, can you please
post back with some more details of the data, the forms, and an example?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top