DataEntry is On - Blank Records adding?

TazAdams

Registered User.
Local time
Today, 16:27
Joined
Apr 18, 2007
Messages
14
Hello All,

I am having some problems with an access form. I have a form named frmEntryDetails - which is joined to: tblSiteLogs, within that I have a subform named frmViewMissingKit which is joined to: tblMissingKit.

The user will fill in the top bit of the form (frmEntryDetails) and then if there is some missing kit, they'll click onto the subform and select items from a dropdown to show what Missing Kit there is for that site.

I have this working, however I am getting blank records added onto tblSiteLogs, along with the actual record I am adding. I have done alot of testing on this and have found out exactly when this blank record is getting added, but I have no idea why and how to stop it.

Scenario:

User fills in the top of frmEntryDetails (these are just text fields and combo boxes). The user is told that there is missing kit for this Entry (site), so looks down at the View Missing kit subform (frmViewMissingKit). There is a button on this subform which opens up another form which allows the user to 'Add Missing Kit to that site'. If the user clicks this button, to add some missing kit, then the details that were already filled in on frmEntryDetails (the text fields and combo boxes) are automatically added onto tblSiteLogs, as a new record - which I obviously don't want.

I have a button at the bottom of the frmEntryDetails form which saves all the data into tblSiteLogs as a new record, however when I click on the button on the subform, to add some missing kit, it does exactly the same as the Save Button, by adding the existing entry to the table which I don't want.

The scenario is averagely complex, so forgive me if I haven't explained myself well enough, I can go through it in more detail if needs be.

I can provide the code if needed.

Any ideas/suggestions are most appreciated

Taz
 
UPDATE: I have found that it is adding the record into tblSiteLogs when I select/setfocus on the subform....
 
In a MainForm/SubForm situation, Access *will* save the bound record automatically when you move the focus from the MainForm to the SubForm or from the SubForm to the MainForm.
 
Thanks RuralGuy,

I have changed the form to an unbound one and used the OpenRecordSet method for saving and it's working fine now.

Ta !
 

Users who are viewing this thread

Back
Top Bottom