Results 1 to 10 of 10
  1. #1
    Pradhansb is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    5

    Posting 2 or more records to the same table from a single form

    Hello! And thank you for your help!
    I am a newbee (but getting better). I am designing a contact-type database for weddings. So my question is simple, although I suspect the answer might require some behind the scenes VBA. In a typical wedding situation, there are 2 main contacts (a bride and groom, etc). Both of these contacts ultimately are added to a contact table, with another related table recording role. I know I can create a form to enter each contact and role 1 at a time, but it would be ideal to create a "Master" entry form which has fields for both contacts, and then with a single Add command button, place the 2 contacts into the 1 contact table.

    In other words, can 2 records be added to 1 table from a single form? Or must I simply create a single form, with an Add another contact button there



    Thanks, and forgive my simplicity about this.

    Pradhan

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Since there's a one-to-many relationship between the wedding and its contacts, you'd typically show this with a form bound to the wedding table and a subform bound to the contacts table. Master/child links keep them in sync with each other. The subform would be in continuous view, thus showing all contacts for that wedding.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Pradhansb is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    5
    Hi Paul, thanks. Showing the datain a subform is easy and done. I'm past that point. I am creating a dedicated form to add a contact to a table. To clarify my question, can I create a form which would have room for 2 contacts and add them both with a single add cmd button. I am simply trying to create an entry form the way a florist would think. Create an project (in this case a wedding), add a bride and groom, as opposed to add a bride, then add a groom. Not a big deal. Theoretically, I thought that my so-called
    Add button would in fact add the first contact, while storing the second, then add the second, then clear the form. I didn't know if this was do-able or even legitimate from a coding standpoint.

    Pradhan

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You could add each to the contacts table with the AddNew method of a recordset in VBA.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by Pradhansb View Post
    .................. Create an project (in this case a wedding), add a bride and groom....................
    Then the main form should be based on the event and the bride and groom should be entered in a sub form.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    Pradhansb is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    5
    Yes, that's how I have structured it...the wedding is kind of a project, which then has participants, venues. Honestly, as a novice, the most difficult part is structuring the data. The florist needs most regular access to the Bride's information. For an advanced Access user, this is a no-brainer, but for a novice, it seems to me this is the most challenging part. Should the contact table be the primary focus of the database to make it easiest to get data? Or should the event? I am learning along the way, and really appreciate your help, and the help of forums like this.

    Thanks again,
    Pradhan

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by Pradhansb View Post
    ..........Should the contact table be the primary focus of the database to make it easiest to get data? Or should the event? I am learning along the way, and really appreciate your help, and the help of forums like this.

    Thanks again,
    Pradhan
    IMHO it should be the event. The event has a one to many relationship to the bride and groom. So main form for the event and sub forme for details of the bride and groom.

  8. #8
    Pradhansb is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    5
    Great! I got that part right!
    Thanks again.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    @pradhansb
    You may get some structure ideas from this free Weddings data model from Barry Williams' site.
    It is generic and includes the most typical "subjects", but you can add or delete to suit your needs.

  10. #10
    Pradhansb is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    5
    I have about 20% of those pieces! That is a great model, and I will study it to get an idea of the underlying thinking. It's doing more than I need but that's just fine. Thank you so much for the reference.
    Pradhan

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

Similar Threads

  1. Adding multiple records to a table using a single button
    By pjordan@drcog.org in forum Queries
    Replies: 8
    Last Post: 04-14-2017, 03:05 PM
  2. Replies: 3
    Last Post: 11-19-2013, 11:30 AM
  3. Replies: 7
    Last Post: 03-28-2013, 06:41 AM
  4. combo box posting to table
    By 237 in forum Access
    Replies: 5
    Last Post: 12-04-2011, 11:36 AM
  5. Replies: 3
    Last Post: 11-16-2011, 11:53 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