B
B. Meincke
My thanks to Marshall for his patience with me in trying to code a database
to check for the presence of the lock file before opening. His suggestion was
to attach the following to the open event of an unbound form that opens at
startup:
If Dir(CurrentProject.Path & "\SRLP Attendance.LDB") <> "" _
Then
MsgBox "The database is in use", vbCritical, "Halt"
Exit Sub
Else
DoCmd.OpenForm ("frmSwitchboard")
DoCmd.Close acForm, "autoexec", acSaveNo
Unfortunately, this is still not working. In my elementary understanding,
this makes sense, as, once the database window is open, the lock file is
already present and the database window opens before the unbound form.
Is there somewhere else I coud put this code that would have it execute
before the lock file appears?
Thanks.
to check for the presence of the lock file before opening. His suggestion was
to attach the following to the open event of an unbound form that opens at
startup:
If Dir(CurrentProject.Path & "\SRLP Attendance.LDB") <> "" _
Then
MsgBox "The database is in use", vbCritical, "Halt"
Exit Sub
Else
DoCmd.OpenForm ("frmSwitchboard")
DoCmd.Close acForm, "autoexec", acSaveNo
Unfortunately, this is still not working. In my elementary understanding,
this makes sense, as, once the database window is open, the lock file is
already present and the database window opens before the unbound form.
Is there somewhere else I coud put this code that would have it execute
before the lock file appears?
Thanks.