record changed by another user

B

betwalk

Hi-

I have a database with a main table and two dependant tables. I do not
offer the user bound forms. I have a main read-only form for display
purposes that shows the primary table and the two child tables which
are also read-only. When the users want to add, edit or delete
anything, they have to click a button that opens an appropriate
intermediate form allowing them to indicate the change or addition they
wish to make to the main form or to any record on a subform. They then
discard or save their additions/changes with buttons on the
intermediate form.

It all is working quite well, but my user discovered that when she adds
a record to one of the subforms, she gets the following error the next
time she attempts to edit any data to the primary record:

"This record has been changed by another user since you started editing
it. If you save the record, you will overwrite the changes the other
user made. Copying the changes to the clipboard will let you look at
the values the other user entered, and then paste your changes back in
if you decide to make changes."

This is followed by 3 buttons: "Save Record", "Copy to Clipboard" &
"Drop Changes". The user tells me that if she clicks "Drop Changes",
her changes are actually recorded and she is able to proceed as if
nothing happened.

Here is my code from the Intermediate form that attempts to save the
changes to the main form and seems to trigger this error message:

Private Sub btnOkayEditPerson_Click()
On Error GoTo Err_btnOkayEditPerson_Click

Dim stDocName As String

DoCmd.SetWarnings False
stDocName = "qryEditPerson"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.Close
DoCmd.SetWarnings True

Exit_btnOkayEditPerson_Click:
Exit Sub

Err_btnOkayEditPerson_Click:
MsgBox Err.Description
Resume Exit_btnOkayEditPerson_Click

End Sub

This does not happen when she adds to the subform, just when she edits
an exsiting child record, and only to one of the child forms. It also
does not happen if she changes to another main record or if she closes
the form and reopens it between editing the child record and trying to
edit the main record.

Sorry this is so long... Any ideas or feedback?

Thanks in advance for any replies!
 

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