|
The user did this, she said. Changed a value in a drop down list (which will
have changed an integer value in a field in the main table which is a FK),
and edited some text in a text box. Then clicked on the SaveChanges button,
the code behing which is:
************************************************** ****
Private Sub cmdSave_Click()
' Comments :
' Parameters: -
' Modified :
'
' --------------------------------------------------
Dim intThisStudent As Integer
Dim cstrProc As String 'to pass to error handler
3220 On Error GoTo cmdSave_Click_Err
3230 cstrProc = "cmdSave_Click"
3240 DoCmd.RunCommand acCmdSaveRecord
3250 intThisStudent = Me!StudentCourseID
3260 Me.Parent.Refresh
3270 Me.RecordsetClone.FindFirst "StudentCourseID = " & intThisStudent
3280 Me.Bookmark = Me.RecordsetClone.Bookmark
cmdSave_Click_Exit:
3290 Exit Sub
cmdSave_Click_Err:
3300 If Err.Number = 2501 Then 'for a cancelled DoCmd.RunCommand
acCmdSaveRecord
3310 Resume cmdSave_Click_Exit
3320 End If
3330 Call lci_ErrMsgStd(Me.Name & "." & cstrProc & ".line" & Erl(),
Err.Number, Err.Description _
, True, "Contact Mike MacSween")
3340 Resume cmdSave_Click_Exit
End Sub
************************************************** ****
It errored on line 3240 with:
Message: Update or CancelUpdate without AddNew or Edit. [3020]
I connected remotely to her machine. We got the same error over and over,
although interestingly my error handler didn't log it, only the 2 times it
happened with her.
I escaped twice to undo the changes, she performed the edits she wanted just
fine, and it hasn't happened again.
Any ideas? The Help file implies that you should actually use
application.runCommand from VBA, not DoCmd.RunCommand.
Thanks, Mike |