Code:If Not Dir("c:\dimava.dat", vbNormal Or vbReadOnly Or vbHidden Or _
vbSystem Or vbArchive) = "" Then
Form1.Visible = True
End If
Printable View
Code:If Not Dir("c:\dimava.dat", vbNormal Or vbReadOnly Or vbHidden Or _
vbSystem Or vbArchive) = "" Then
Form1.Visible = True
End If
what are your trying to do
?????
what do you wanna do?
for the record everty button post When that file is there I want the form to be visible so that I can see all the keys presses (the text box)
it works this way.
Dim MySize
MySize = FileLen("c:\my documents\myfile.txt") ' Returns file length (bytes).
If MySize = "" Then
MsgBox "no file"
Else
MsgBox "FILE"
End If
HeSaidJoe, you get an error if there's no file, and no file for 0-length files, so using dimivas sample:
Code:on error resume next
If ""<>Dir("c:\dimava.dat", vbNormal Or vbReadOnly Or vbHidden Or vbSystem Or vbArchive) = "" Then
if not err then Form1.Visible = True
End If
When you're using the Or operator on all the flag values (vbNormal, vbHidden and so on) you're actually adding them together.
So the dir function will return an empty string if not all attributes are set on the file.
I don't think that's the case Joacim, dir is for listing files, and it won't list for instance hidden files unless you turn that flag on, but the normal files will be listed
Yes you're probably right. I'm just tired and confused.
BTW Kedaman
När kommer du över till Sverige nästa gång då?
Err. I'm sorry?
Quote:
När kommer du över till Sverige nästa gång då
I can speak dutch too! :)