Ok I have the following code:
Option Compare Database
Private lngFile As Long
Private Sub Form_Load()
If Dir("D:\Data\Lockout.txt") <> "" Then
MsgBox "Sorry, someone else is using this file. Try again later."
lngFile = FreeFile
Open "D:\Data\Lockout.txt" For Output As lngFile
Private Sub Form_Unload(Cancel As Integer)
In the MsgBox how can I put MsgBox "Sorry (lookup userid field from usertable who is using the file) is using the file"
For exampl, say John is using the file and Mike want to open....
Mike should get the message "Sorry John is using the file, Try again later"