Saving record

eacollie

Registered User.
Local time
Today, 08:57
Joined
May 14, 2011
Messages
159
I have a main form and subform. The main form is bound to a table of invoices and the subform to a table of invoice items.

I'm picking up the invoice number from the form to save it to the invoice items table, so I need to save the record for the invoice before saving the invoice items from the subform.

What is the best way to do this?

Thanks so much!
 
Typically the invoice number would be the field in the master/child links, since it's the field that relates the two. In that event, Access would take care of that for you.
 
As Paul said, the standard way of doing this would be using the link master fields/link child fields, which automatically takes care of all of the heavy lifting involved with Main Form/Subforms, but the very act of moving from the Main Form to the Subform will, in fact, automatically save the Main Form Record.

Linq ;0)>
 
thanks missingling.

That's not happening on my form, so I'm not sure what I'm doing wrong. I enter the form from another that checks to see if an invoice exists for this record and if not: DoCmd.OpenForm "frmInvoice", acNormal, , , acFormAdd

The invoice number is "new" and remains that even when I enter the subform and try to add invoice items. I have the main form and subform linked correctly, so not sure what I'm doing incorrectly.
 
The only thing I can think of that would (possibly) cause this is that the Main Form Record has not actually be Dirtied. Is data actually entered into this Record by the user, as opposed to everything being Default Values or automatically generated Values?

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom