Jet Engine Error Message


A

Anne

I have a error message The Jet Engine stopped the process because you and
another user are attempting to change data at the same time.

This is my code on the form.

I'm not sure 1) how to prevent this in the future and 2) how to correct the
corrupt files - I tried a compact and repair and that didn't work.
Option Compare Database

Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click


DoCmd.GoToRecord , , acNewRec

Exit_cmdAddNew_Click:
Exit Sub

Err_cmdAddNew_Click:
MsgBox Err.Description
Resume Exit_cmdAddNew_Click

End Sub

Private Sub cmdDelete_Click()

Dim intAnswer As Integer
Dim strDataEntered As String

On Error GoTo Err_cmdDelete_Click

intAnswer = MsgBox("Are you sure that you want to delete this record?",
vbOKCancel, "Delete Record")

'If answer is Cancel then don't delete record
If intAnswer = 2 Then
Exit Sub
End If

strDataEntered = ""
strDataEntered = strDataEntered & DatePerformed & TotalTravelTime &
TimeSpent & TotalKMS & ClosingComments & PartsUsed

If strDataEntered <> "" Then
MsgBox "You can't delete this record because data has been entered
into the grey are."
Exit Sub
End If

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub

Private Sub cmdFind_Click()
On Error GoTo Err_cmdFind_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdFind_Click:
Exit Sub

Err_cmdFind_Click:
MsgBox Err.Description
Resume Exit_cmdFind_Click

End Sub
Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click


DoCmd.GoToRecord , , acNewRec

Exit_cmdAdd_Click:
Exit Sub

Err_cmdAdd_Click:
MsgBox Err.Description
Resume Exit_cmdAdd_Click

End Sub

Private Sub Form_BeforeInsert(Cancel As Integer)
WorkOrderType.Value = 1
End Sub
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

'Save record before printing in case it is a new record,
'Otherwise the page would be blank.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

stDocName = "rptWorkOrder2"
DoCmd.OpenReport stDocName, acNormal, , "WorkorderID=" & Me.WorkorderID

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

Private Sub Print_Click()

End Sub
 
Ad

Advertisements

C

Crystal (strive4peace)

Hi Anne,

This error message can happen if you have only one user but
two forms open for editing the same table

~~~

you should change the DoCmd.DoMenuItem code to something
more readable...

instead of
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

use
DoCmd.RunCommand acCmdSelectRecord

here is a link to help you with the rest:

Converting DoMenuItem to RunCommand
http://www.accessruncommand.com/domenuitem.htm

~~~

Warm Regards,
Crystal
remote programming and training
http://MSAccessGurus.com

free video tutorials
http://www.YouTube.com/user/LearnAccessByCrystal

Access Basics
http://www.AccessMVP.com/strive4peace
free 100-page book that covers essentials in Access

*
:) have an awesome day :)
*
 
Ad

Advertisements

S

Steve

That error message usually occurs if you have more than one form open that
are bound to the same table either directly or through a query. Check if
this is the case.

Steve
(e-mail address removed)
 

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