I have a module called GetFile() that verifies a network connection.
Public Function GetFile()
If Dir("\\city_server\engr_files\sidewalks\2005\swk_05.mdb") = "" Then
MsgBox "Could not locate file - please verify network connection..."
Else
DoCmd.RunMacro ("macImport")
End If
End Function
If the files does not exist, it returns the MsgBox message. However, if the network connection is unavailable (i.e., unplugged), it returns Run-time error 52 > Bad file name or number.
What I want if the laptop is inadvertently unplugged, to return the MsgBox.
Thanks,
SKK
Public Function GetFile()
If Dir("\\city_server\engr_files\sidewalks\2005\swk_05.mdb") = "" Then
MsgBox "Could not locate file - please verify network connection..."
Else
DoCmd.RunMacro ("macImport")
End If
End Function
If the files does not exist, it returns the MsgBox message. However, if the network connection is unavailable (i.e., unplugged), it returns Run-time error 52 > Bad file name or number.
What I want if the laptop is inadvertently unplugged, to return the MsgBox.
Thanks,
SKK