Link to home
Start Free TrialLog in
Avatar of TerenceHewett
TerenceHewett

asked on

The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes". "Re-edit the record"

Hi experts,

I have two subforms that are using the same recordset as the main form.  I have them as two seperate sub forms because I do not want all the information on display at the same time.  I toggle between both sub forms with two buttons. My main form that is driving the sub forms has a list box on it and the list box is driving each record on both sub forms using the ID field in the Master and Child Links.

When I edit text within either sub form, I get the following message when I select the next record in the list box:

"The data has been changed.  Another user edited this record and saved the changes before you attempted to save your changes".  "Re-edit the record".  "OK".

When I click on OK, the record does update, but I would like the message box not to appear.  Can anyone help me?

Thank you.
Terry
Avatar of jefftwilley
jefftwilley
Flag of United States of America image

in the after update event of each subform, you could try using

on error resume next
Avatar of Jeffrey Coachman
TerenceHewett,

<I have two subforms that are using the same recordset as the main form>
Then why not use two separate forms? And use a button to open them from each other?

Try saving the record after the edits.

So put code like this on the Toggle button:
Sub YourButton_Click()
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    ' Your "Swap Subform" code here
End sub
Avatar of TerenceHewett
TerenceHewett

ASKER

Thank you for your suggestions.  I have tried both, and both have not worked. I get the same message each time.  The message appears when I change text in a sub form and then try moving to another record.  Any other ideas that might help?

Regards,
Terry
ASKER CERTIFIED SOLUTION
Avatar of kerryw60
kerryw60

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
Thanks for all posts.  Kerry, I took you suggestion and it now works well. Thank you very much.

Have a great Christmas, all of you.

Regards,
Terry