Results 1 to 5 of 5
  1. #1
    raindella is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2

    Subform - adding new records is creating duplicates and not saving to table

    My form has one unique identifier, a combo box. The user chooses a selection on the main form combo box.

    My subform has 2 combo boxes and 2 text fields.
    Users choose a selection from a list in each combo box. Then enter text in the text fields.
    There will be multiple records entered on the subform for each number chosen on the main form.

    When I try to enter records in the sub form, its creating multiples records that are all the same. These records show on the form. But are not saving to the table.



    I'm not an expert in sub forms and how they work. Are they supposed to automatically allow new records to be entered?
    I put in a "Add New Record" command button and tried various code behind it, such as
    Code:
     DoCmd.GoToRecord , , acnewrecord
    and setting focus to the first combo box in my sub form.
    But I can't get the form working correctly.

    It should be a pretty simple straightforward form with subform.
    Does anyone have a link to info creating a subform, and what properties I should have selected.

    thanks a lot!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    As long as the Form that you are using as a SubForm has AllowAdditions set to True, your SubForm when displayed should have a "*" record on the bottom.

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Are all of the fields on the sub-form bound to table fields? If all the records on the subform contain the same values, it suggests that some are not. When you say the records are not being saved to "the Table" - which table do you mean? If you see multiple records on the sub-form, the data is being saved somewhere.

    John

  4. #4
    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
    See my response to your identical thread here

    http://www.utteraccess.com/forum/Sub...-t1988638.html

    Linq ;0)>

  5. #5
    raindella is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2
    On my subform I have 5 fields.
    2 combo boxes, one with categories, and the 2nd one displays items depending on which category was picked in first combo box.
    The combo boxes are working.
    These combo box fields say "unbound". Which I don't really understand why, because they select the info from a table to display in the drop down list.
    My 2 other fields are text fields for entering data.
    And there is one field that gets an ID # from my main form. On my main form I only have one field , this ID# which is pulled in from a previous form.
    In my current subform, when I try to enter a record, tabbing takes me through all my fields on the subform then back to the ID # field on my main form. It won't tab to a new record / row in my subform. And at the bottom of my subform, the "new record" tiny icon is grayed out.
    How do I get my subform to tab to a new blank record to allow me to enter records?
    I have allow additions set to yes. And format set to Datasheet.
    My subform has in Record Source -to select from my table which has the names of all 5 fields on my subform.

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

Similar Threads

  1. Adding new partial records to a subform
    By DarkWolff in forum Forms
    Replies: 7
    Last Post: 03-06-2012, 04:05 PM
  2. VBA code for adding records to a table
    By pwalter83 in forum Forms
    Replies: 3
    Last Post: 12-21-2011, 10:52 AM
  3. Adding Records in a Subform
    By chris.williams in forum Forms
    Replies: 3
    Last Post: 10-14-2011, 01:21 PM
  4. Adding multiple records in subform
    By randolphoralph in forum Programming
    Replies: 1
    Last Post: 05-12-2010, 09:42 PM
  5. Replies: 1
    Last Post: 05-27-2006, 12:35 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