Saving Records in a Subform

  • Thread starter James Tully via AccessMonster.com
  • Start date
J

James Tully via AccessMonster.com

I am using:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

In a subform under a save button to save a record after an add of a new
record to a table with a primary key that does not allow duplicates. I
allow the user to add more records with a new record button which uses:
DoCmd.GoToRecord , , acNewRec

The subform is closed only when the parent form closes. After adding one
or more records, saving them and closing I always get the error or warning:

?The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
Change the data in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit duplicate entries and try again.?

The form closes OK and the records added are there and do not have
duplicate keys.

My question is why the message? Doesn?t DoCmd save menu call clear the
?dirty? flag? Seems like Access trying to save again at form close.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top