Share via

Table entering a record with no data from form button click

Mark Truett 20 Reputation points
2026-03-11T21:34:33.66+00:00

I have a relational database table (itemTable) connected to a Main Form. Connected to the main form is a sub Form (itemImages)Connected to ItemImageTable . After Adding the item data, i go to enter the item images on the sub form but, after adding the image, the tables save another record with no image. Then when i add another image for the same item its save it and another record with no image. When I look at my images table it alternates a row with data and a row without data. I have a combo box to identify the image type, Front view, back View etc. I found that when I select a view type the form "Hiccups" and the blank record will appear,or the same will happen if i select the image picker button first, "Hiccup" & blank record appears. so if i add 2 images I'll have 4 records alternating one with the image and one without. The images are not imbedded they are displayed on an image object via file location/filename. Thanks

Microsoft 365 and Office | Access | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. DBG 11,696 Reputation points Volunteer Moderator
    2026-03-11T22:42:21.86+00:00

    Are you using any code to add the new image record? A subform automatically saves the new record, so if you're also using code when entering records (images) in the subform, perhaps you're accidentally creating those blank records. If you're using code, can you show it to us? Also, maybe posting a screenshot of your form and subform setup might help understand your situation better.

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Mark Truett 20 Reputation points
    2026-03-12T19:40:11.2966667+00:00

    My Issue was resolved and I posted pictures of my forms and code in the comments above as requested by other users. I'm looking forward to their comments being a novice user i'm always open to suggestions


  2. George Hepworth 22,655 Reputation points Volunteer Moderator
    2026-03-12T01:31:23.5866667+00:00

    I agree with DBG's analysis and would also like to see the forms and any code involved.

    Thanks for helping us help you.

    0 comments No comments

  3. Q&A Assist
    2026-03-11T21:34:54.7+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The behavior indicates that the subform is creating a new (blank) record each time a control change or button click causes Access to move off the current record. In Access, a new record is automatically created when data is entered into any control in the “new record” row and the focus then moves to another record.

    To prevent extra blank records in the images table:

    1. Ensure that the subform is bound correctly
      • The subform (itemImages) should be bound to the images table (ItemImageTable) and linked to the main form by the key fields (e.g., ItemID). This ensures that each image record is correctly related to the current item and that navigation between records does not create unintended extra rows.
      • Use the subform’s default navigation and record handling instead of manually forcing record moves in code.
    2. Avoid code that forces a record save or moves to a new record
      • Check the combo box’s events (After Update, On Change, etc.) and the image picker button’s On Click event for any code that:
        • Calls DoCmd.GoToRecord , , acNewRec or similar
        • Explicitly moves to another record
        • Forces a save and then moves focus to the new record row
      • Remove or adjust such code so that it only updates controls on the current record and does not move to a new record.
    3. Use the subform’s datasheet or continuous form behavior as intended
      • When adding a new image, enter all required data (including the combo box selection and file path/filename) while staying on the same record row.
      • Only move to another record (or close the form) after all fields for that image have been entered. Access will then save that single record.
    4. Verify table-level behavior
      • Open the images table (ItemImageTable) in Datasheet View and add a record manually to confirm that only one record is created when data is entered and focus moves away from that row.
      • This confirms that the extra blank records are caused by form behavior (navigation or event code) rather than the table itself.
    5. If needed, explicitly save the current record without moving
      • Instead of moving to a new record in code, use an explicit save on the current record (for example, via a command button that saves the current record) and keep the focus on the same record so that Access does not create a new blank row.

    These steps keep the subform from unintentionally navigating to the “new record” row, which is what causes alternating populated and blank records in the images table.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.