How to deter empty directory

rickyfong

Registered User.
Local time
Today, 09:28
Joined
Nov 25, 2010
Messages
199
In Access, how to determine a directory with given path which is empty?? Thank a lot!!
 
Code:
DIM PATH AS STRING
PATH ="F:\ABC"
If Len(Dir("PATH & '\*.TIF'")) = 0 Then
MsgBox "NOT FOUND"
Else
MSGBOX "FOUND FILES!"
End If]

SORRY! No matter the ABC got files or not, the len function always = 0!! Any idea?? Thanks!!
 
Can you see the problem Ricky?
Code:
If Len(Dir([COLOR="Red"]"PATH[/COLOR] & '\*.TIF'")) = 0 Then
 
Path is a reserved word in ACCESS?? However, If I changed to PATH1, the LEN still given a zero value in one way or another!!
 
Test this . . .
Code:
MsgBox "PATH & '\*.TIF'"
. . . and see what you get. Not what you expect.
 
Yes! You are right, I think the problem is that I have to do the following:

Dim P1 as STRING
P1 = PATH & "*.TIF"
IF LEN(DIR(P1)) = 0 then .....

I suppose the P1 should be bounded by "", but it seems it shouldn't be!! Thanks a lot!!
 
P1 = PATH & "*.TIF"
I suppose the P1 should be bounded by "", but it seems it shouldn't be!! Thanks a lot!!
No! Compare how you wrote PATH here and how you wrote it in your first post and pay attention to the quotes. Can you spot the difference?
 

Users who are viewing this thread

Back
Top Bottom