Link to home
Start Free TrialLog in
Avatar of anthonytr
anthonytrFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Subform creates extra records

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?
Avatar of COACHMAN99
COACHMAN99

are you opening the form with the 'acFormAdd' data mode switch? (as opposed to acFormEdit)
Avatar of anthonytr

ASKER

I'm opening it with:

DoCmd.OpenForm "frm_reference_data", , , , , , batch_reference
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?
Avatar of PatHartman
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.
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?
ASKER CERTIFIED SOLUTION
Avatar of anthonytr
anthonytr
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I found the error and fix myself