From: Anne on
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




--
Anne
From: Crystal (strive4peace) on
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 :)
*


Anne wrote:
> 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
>
>
>
>
From: Steve on
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
santus(a)penn.com


"Anne" <Anne(a)discussions.microsoft.com> wrote in message
news:AC3DD2B4-E0D3-496D-B677-5174A4B91B3A(a)microsoft.com...
>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
>
>
>
>
> --
> Anne


 | 
Pages: 1
Prev: test de client nntp
Next: domenica