R rickyfong Registered User. Local time Today, 13:03 Joined Nov 25, 2010 Messages 199 Jul 10, 2014 #1 In Access, how to determine a directory with given path which is empty?? Thank a lot!!
GinaWhipp AWF VIP Local time Today, 16:03 Joined Jun 21, 2011 Messages 5,899 Jul 10, 2014 #2 Have a look at... http://www.techonthenet.com/access/functions/file/dir.php
R rickyfong Registered User. Local time Today, 13:03 Joined Nov 25, 2010 Messages 199 Jul 10, 2014 #3 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!!
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!!
V vbaInet AWF VIP Local time Today, 21:03 Joined Jan 22, 2010 Messages 26,374 Jul 10, 2014 #4 Can you see the problem Ricky? Code: If Len(Dir([COLOR="Red"]"PATH[/COLOR] & '\*.TIF'")) = 0 Then
R rickyfong Registered User. Local time Today, 13:03 Joined Nov 25, 2010 Messages 199 Jul 11, 2014 #5 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!!
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!!
MarkK bit cruncher Local time Today, 13:03 Joined Mar 17, 2004 Messages 8,472 Jul 11, 2014 #6 Test this . . . Code: MsgBox "PATH & '\*.TIF'" . . . and see what you get. Not what you expect.
R rickyfong Registered User. Local time Today, 13:03 Joined Nov 25, 2010 Messages 199 Jul 11, 2014 #7 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!!
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!!
V vbaInet AWF VIP Local time Today, 21:03 Joined Jan 22, 2010 Messages 26,374 Jul 11, 2014 #8 rickyfong said: P1 = PATH & "*.TIF" I suppose the P1 should be bounded by "", but it seems it shouldn't be!! Thanks a lot!! Click to expand... 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?
rickyfong said: P1 = PATH & "*.TIF" I suppose the P1 should be bounded by "", but it seems it shouldn't be!! Thanks a lot!! Click to expand... 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?