Solved

Subform creates extra records

Posted on 2014-04-07
7
498 Views
Last Modified: 2014-04-18
Hi,

I have a form with a subform.  The main form is bound to to a table and the subform is bound to a query.  

I open the form from another form passing an ID via OpenArgs.  The Subform and main form are linked via Child and parent fields.  I can enter data into the subform and all looks fine, however, when i look at the table for the subform i can see that it creates a blank entry into the table.

Does anyone know what is causing this and how to stop it?
0
Comment
Question by:anthonytr
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39984758
are you opening the form with the 'acFormAdd' data mode switch? (as opposed to acFormEdit)
0
 

Author Comment

by:anthonytr
ID: 39984760
I'm opening it with:

DoCmd.OpenForm "frm_reference_data", , , , , , batch_reference
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39984781
Looks OK.
This may be an invalid question but are you sure there is a blank record? (when you open a table the last record is blank; ready to enter a new record.
Can you attach the database?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 34

Expert Comment

by:PatHartman
ID: 39986137
There will be an asterisk (*) in the record selector and the fields with defaults will be populated so it looks like a real record but it isn't.   It is just ready to add.
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39986251
Looks OK.
This may be an invalid question but are you sure there is a blank record? (when you open a table the last record is blank; ready to enter a new record.
Can you attach the database?
0
 

Accepted Solution

by:
anthonytr earned 0 total points
ID: 39997292
I reset the database and re-created to the forms and subforms and the error has gone away.  Strange - not quite sure what was causing it.
0
 

Author Closing Comment

by:anthonytr
ID: 40008421
I found the error and fix myself
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This video teaches viewers about errors in exception handling.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now