Function FileIsOpen(sFilePathName As String)
Dim iFileNum As Integer, iErrNum As Integer
On Error Resume Next
iFileNum = FreeFile()
Open sFilePathName For Input Lock Read As #iFileNum
Close iFileNum
iErrNum = Err.Number
Select Case iErrNum
Case 0
FileIsOpen = False
Case 70
FileIsOpen = True
Case Else
FileIsOpen = True
End Select
End Function
Private Sub Form_Load()
MsgBox FileIsOpen("c:\ccu.mdb")
End Sub