1

Topic: Error "It is impossible to use a file" in a multiple user mode (access)

Dear experts!
There is a partitioned basis (a file with tables in a network folder and a file with forms and the code on a computer at the user).
For one of forms event the Timer (the code is found somewhere here at a forum, is used forcedly to throw out users from the program) is processed.

Private Sub Form_Timer ()
Dim AbortNow As Boolean
AbortNow = Nz (DLookup ("ExitNow", "Abort"), False)
If AbortCounter> 0 And AbortNow Then
Application. Quit ' we Quit the program.
End If
If AbortNow Then ' we Deduce the warning and we wait further.
AbortCounter = AbortCounter + 1 ' Now, at following actuating of the timer, works an output from the program.
DoCmd. OpenForm "frmExit" ' we Show the form - .
End If
End Sub

Periodically (often) at any user the error "jumps out It is impossible to use (a way and a name of the network file with table Abort); the file is already used."
The stop happens at line: AbortNow = Nz (DLookup ("ExitNow", "Abort"), False)
The folder is accessible to all users on a read and write (about 40 foreheads). I suspect that the such happens while simultaneously two (or more) the user address to table Abort. Event the Timer happens to periodicity 30 seconds
Push, in what side to look?

2

Re: Error "It is impossible to use a file" in a multiple user mode (access)

F, in adjustments there is "a Lock by default" - "misses"

3

Re: Error "It is impossible to use a file" in a multiple user mode (access)

dormio, add error handling:

Option Compare Database
Option Explicit
Dim AbortCounter As Long
Dim defaultInterval As Long
Private Sub Form_Open (Cancel As Integer)
defaultInterval = Me. TimerInterval
End Sub
Private Sub Form_Timer ()
Dim AbortNow As Boolean
On Error Resume Next
AbortNow = Nz (DLookup ("ExitNow", "Abort"), False)
If Err <> 0 Then
On Error GoTo 0
Me. TimerInterval = 2000
Exit Sub
End If
On Error GoTo 0
Me. TimerInterval = defaultInterval
If Not AbortNow Then
AbortCounter = 0
On Error Resume Next
DoCmd. Close acForm, "frmExit"
On Error GoTo 0
Exit Sub
End If
If AbortCounter> 0 Then Application. Quit
AbortCounter = AbortCounter + 1
DoCmd. OpenForm "frmExit"
End Sub

I.e. if there is an error at reversal we do a pause for 2 seconds, then continue.
By the way, at you the form frmExit could open, and if the manager before following actuating of the timer would change in table Abort field value ExitNow on False form ExitNow not on business would remain opened.