Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help

0 views
Skip to first unread message

Jone

unread,
Nov 12, 2007, 3:18:01 PM11/12/07
to
What code do I write when I want my main menu form to check for a file before
it opens if it cannot find the file it should not open ? for Ex. check if I
have the file C:\Windows\Sample.txt if it cannot find if it should not open

I got form somone this ***If Dir("C:\Windows\Sample.txt") <> vbNullString
Then** BUT IT DOSE NOT WORK!

Douglas J. Steele

unread,
Nov 12, 2007, 3:28:49 PM11/12/07
to
What does that code do if it doesn't work?

Here's a slight variation that I prefer:

If Len(Dir("C:\Windows\Sample.txt")) > 0 Then
' the file exists
Else
' the file does not exist
End If

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jone" <Jo...@discussions.microsoft.com> wrote in message
news:1D111BA4-C992-4FBF...@microsoft.com...

Jone

unread,
Nov 12, 2007, 6:18:13 PM11/12/07
to
It worked thank you !
0 new messages