Results 1 to 7 of 7
  1. #1
    dgmdvm is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    84

    Subform Question-adding multiple records at once

    I have a database with 3 related tables. The main table is linked to the main form and there are two subforms, each linked to one of the other 2 tables. The main table has a one to many relationship with the two child tables. In one of my subforms, I would like to be able to enter multiple items, each of which end up as a new record in the child table- all linked to the same record in the main table. I want to enter all the items and only have to save the form once after all the data has been entered. I can get this to work if the subform is in datasheet view-using the down arrow key opens a new record in the subform so I can enter all the items at once. Is there any way to do this with the subform in form view? I tried continuous forms and changing settings but haven't had any success.



    thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I want to enter all the items and only have to save the form once after all the data has been entered.
    Each record entered is saved when you move to a different record/new record/close the form.

    Is there any way to do this with the subform in form view? I tried continuous forms and changing settings but haven't had any success.
    Sure. I never use a sub form in datasheet view, always in Continuous Forms view.

    Can you post your dB with just a few example records? Do a "Compact & Repair", then Zip it before attaching to a post.

  3. #3
    dgmdvm is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    84
    Quote Originally Posted by ssanfu View Post
    Each record entered is saved when you move to a different record/new record/close the form.


    Sure. I never use a sub form in datasheet view, always in Continuous Forms view.

    Can you post your dB with just a few example records? Do a "Compact & Repair", then Zip it before attaching to a post.

    Here is my database.You will note the items subform is in data sheet view so that I can add gift items and use the down arrow key to add additional items for the same individual.The functionality of the database is what I want, but I want the subform to be in form view.

    Thanks.
    Attached Files Attached Files

  4. #4
    dgmdvm is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    84
    Steve,
    Since I have 2 different threads about the same project, I am going to make all future comments in this thread. The other thread URL was: https://www.accessforums.net/showthread.php?t=63349

    I reviewed the changes you made to my original database. It works perfectly. I do have some questions about it.
    Why did you not create a relationship between the tables? Was the fact that master/child links were established sufficient to relate the tables?
    Why is there no primary key in the family information table (although the field SystemID_PK implies that it is the primary key)?
    The field "SystemID_PK in the family information table and the System ID_FK in the Gift items table have the same value (appropriately so). What mechanism is causing them to be the same?

    Thanks

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Why did you not create a relationship between the tables? Was the fact that master/child links were established sufficient to relate the tables?
    Actually, I did create a relationship. Open the relationship window, right click, then and select "Show All".


    Why is there no primary key in the family information table (although the field SystemID_PK implies that it is the primary key)?
    Yes, it implies the field "SystemID_PK" is the PK field; also the key icon shows that it is the PK field (open the table in design view)


    The field "SystemID_PK in the family information table and the System ID_FK in the Gift items table have the same value (appropriately so). What mechanism is causing them to be the same?
    Because the main form is based on the "FamilyInformation" table and the sub form is based on the "GiftItemsTable" table, the two forms are linked by the PK/FK fields.
    The "GiftItemsTable.System ID_FK" field is automatically filled in (by Access) with the value from "FamilyInformation.SystemID_PK" field.


    Your idea relating the tables is right, but why do you have a field "ID Number" instead of using the PK (autonumber) field?
    Look at the fields in the table I posted, then look at your table fields.


    I still maintain that the design of your "GiftItemsTable" table is wrong.
    Again:You have Shirts, Pants, Shoes as field names: Shirts, Pants, Shoes are really DATA.
    What happens when you want to add Jacket or Tie or Dress? You would have to redesign your tables, forms, queries and reports.

    In your new dB, "Gift Tree Database Trial", You've had to add ANOTHER table to handle legos, toys, onesies, etc.
    In the design I proposed, it is one table and you can add anything.....

    I'm just sayin.......


    (also note that you should remove ALL spaces in object names)

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by dgmdvm View Post
    Since I have 2 different threads about the same project, I am going to make all future comments in this thread. The other thread URL was: https://www.accessforums.net/showthread.php?t=63349
    FYI, to prevent confusion I closed the other thread. You had already linked to this one, so anybody with anything to add there should find this thread. We didn't want to have 2 threads open on the same topic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    dgmdvm is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    84
    Actually, I did create a relationship. Open the relationship window, right click, then and select "Show All".
    Got it, I didn't have that selected so it was originally blank. That makes more sense

    Your idea relating the tables is right, but why do you have a field "ID Number" instead of using the PK (autonumber) field?
    I want each individual to have their own unique number- starting at 1 each year that I do this. The autonumber system won't easily let you do that.


    I still maintain that the design of your "GiftItemsTable" table is wrong.
    Again:You have Shirts, Pants, Shoes as field names: Shirts, Pants, Shoes are really DATA.
    What happens when you want to add Jacket or Tie or Dress? You would have to redesign your tables, forms, queries and reports.

    In your new dB, "Gift Tree Database Trial", You've had to add ANOTHER table to handle legos, toys, onesies, etc.
    In the design I proposed, it is one table and you can add anything.....

    I'm just sayin.......
    I agree with you now- I played around with my design today and it just wasn't right so I am re-designing it your way. Your technique is simpler too.

    thanks so much- now on to recreating some of the reports and other features of my original database!

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

Similar Threads

  1. Adding Records to a Table From Form Question
    By McArthurGDM in forum Access
    Replies: 1
    Last Post: 03-11-2015, 07:35 PM
  2. Replies: 1
    Last Post: 10-21-2012, 04:57 PM
  3. Adding/Editing Records through a subform
    By Antinomy in forum Forms
    Replies: 17
    Last Post: 06-30-2012, 07:29 PM
  4. Adding Records in a Subform
    By chris.williams in forum Forms
    Replies: 3
    Last Post: 10-14-2011, 01:21 PM
  5. Adding multiple records in subform
    By randolphoralph in forum Programming
    Replies: 1
    Last Post: 05-12-2010, 09:42 PM

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