Re: ErrorMessage when file is missing
From: Jim Edgar (djedgarNOSPAM_at_cox.net)
Date: 12/26/04
- Next message: Cor Ligthert: "Re: Disposing of Objects."
- Previous message: Cor Ligthert: "Re: Disposing of Objects."
- In reply to: reidarT: "ErrorMessage when file is missing"
- Next in thread: Herfried K. Wagner [MVP]: "Re: ErrorMessage when file is missing"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 26 Dec 2004 10:07:56 -0800
> Dim Kildefil as object
>
> Kildefil = "H:\dbBil\dbBil.mdb"
>
> if not Dir(Kildefil)) Then
> else
> Msgbox("Can't find file!",msgboxstyle.information,conMelding)
> end if
>
> I get this error when file is missing.
>
> Change form string to type Long is not legal.
> regards
> reidarT
>
>
The Dir() function returns a string and the syntax you used
*may* be trying to coerce the string to a long. Try this
syntax:
If Dir(Kildefil) <> "" Then
' Found the file
Else
' File not found
Msgbox("Can't find file!",msgboxstyle.information,conMelding)
End If
HTH,
J Edgar
- Next message: Cor Ligthert: "Re: Disposing of Objects."
- Previous message: Cor Ligthert: "Re: Disposing of Objects."
- In reply to: reidarT: "ErrorMessage when file is missing"
- Next in thread: Herfried K. Wagner [MVP]: "Re: ErrorMessage when file is missing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|