Option Compare Database
Option Explicit
Public Const strLockPath = "C:\GCRDB\" 'db path here
Public Const strLockFN = "AppLock.flg" 'anyname here
Public Sub basLogOutRemove()
On Error Resume Next
Close #1
Kill strLockPath & strLockFN
End Sub
Public Sub basLogOutCheck() As Boolean
On Error Resume Next
basLogOutCheck = Dir(strLockPath & strLockFN) = strLockFN
End Sub
Public Sub basLogOutCreate()
On Error Resume Next
Open strLockPath & strLockFN For Output Shared As #1
End Sub
''paste this into your startup form
Private Sub Form_Load()
On Error Resume Next
Kill strLockPath & strLockFN
If basLogOutCheck Then
Application.Quit
End If
End Sub
''paste this into last form to close
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
basLogOutRemove
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.