We help IT Professionals succeed at work.

Subform adds always two records instead of only one...

Michael Paravicini
Last Modified: 2018-02-14
My subform always adds one record too many.. and not sure way. I always have two records although in the datasheet i only see one. As soon as I save the form a second record is created with zero values. Not sure what I'm doing wrong.. Thanks for any help!
Watch Question

Ares KurkluSoftware Engineer

You need to know where exactly the problem is, are there duplicate entries in the tables? in that case the program may be inserting twice
or there can be a problem with the display query it may be displaying it twice if there is something wrong with the join.
Distinguished Expert 2017

The problem is caused by code behind your form.  You are dirtying a record and saving it and then the user is doing the same.  Please post all the code behind the form and we'll help you figure it out.


Hi Pat, I'm really at a loss. I can't find anything special.. I call the Subform from an existing subform as follows:

Call OpenFrame("frmResRates",  acNormal, "", "ResId=" & Me.RESID, IIf(Me.AllowEdits, acFormEdit, acFormReadOnly), acWindowNormal)

OpenFrame is a SUB used to openframes and validate user rights. In the Load() sub of the opened framed, I only have the following code:

Private Sub Form_Load()
' Show Form in correct Language
Call FormTranslate("frmResRates", "3", gUser.Lang)
Call SubFormTranslate("frmResRates", "ResRatesSubform", "4", Nz(gUser.Lang, "EN"))

' Check if read only
Call FormDisable("frmResRates", "ResRatesSubform", Me.AllowEdits)

' Fill in Default Data
Me.xGuestName = Forms!frmResGroup!frmResDetails!xGuestName
Me.RESID = Forms!frmResGroup!frmResDetails!RESID
End Sub

And the Save button only has a DoCmd.Close command. That's it... Any help would be tremendeously appreciated...


I just saw - the error only occurs if I click into the subform and change something. In this case it will add two rows while if I just save it immediately only one row gets saved....
Distinguished Expert 2017
This one is on us!
(Get your first solution completely free - no credit card required)


Pat - you were absolutely right... I had a duplicate ID field which caused the problem.. Everything is working fine now.. Thank you for your help!
Distinguished Expert 2017

You're welcome.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.