Results 1 to 2 of 2
  1. #1
    sgp667 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    17

    One Form Field to populate Fields in multiple tables

    I have a form where I need to input Invoices. First I need to input invoice number, this is primary key in table "Invoices".
    That Invoice number also serves as a foreign key in table "Invoice Items", and those items will be inputted in the same form.



    In other words what I need is a form that will create a record in "Invoices" and multiple records in "Invoice Items" with each record having Invoice# as one of the fields.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You're describing a classic one-to-many relationship, here, and this is typically done by using a Main Form (based on the Invoice Table) and a Subform (based on the Invoice Items Table).

    The Main Form will be in Single View, the Subform in Datasheet View.

    After creating both Forms, go into Design View for the Main Form and add a Subform Control. When prompted by the Wizard, select the Invoice Items Form as the base for the Subform. If the Invoice Number Field is named the same in each Table, Access will automatically link the Main Form/Subform using this Field, and when you go into the Subform, the Invoice Number will automatically be populated.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 08-02-2012, 10:50 AM
  2. Replies: 3
    Last Post: 02-06-2012, 10:34 AM
  3. Replies: 8
    Last Post: 12-05-2011, 01:55 PM
  4. Replies: 4
    Last Post: 01-20-2011, 10:05 PM
  5. Replies: 3
    Last Post: 10-05-2009, 07:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums