
Signature
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
The Dir function isn't guaranteed to return the files in any specific order.
When you say it's skipping 0708, does it eventually find it if you keep the
code running?

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Here's my code:
>
[quoted text clipped - 8 lines]
> "0707"
> to "0709" and skips "0708". any ideas?
ragtopcaddy - 20 Mar 2008 18:56 GMT
Douglas,
I'll soon find out!
Thanks for your reply,
>The Dir function isn't guaranteed to return the files in any specific order.
>
[quoted text clipped - 6 lines]
>> "0707"
>> to "0709" and skips "0708". any ideas?

Signature
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
ragtopcaddy - 20 Mar 2008 19:11 GMT
Doug,
No dice! There are 12 files in the directory, but even with my manually
resetting strFileName on the 1st couple of passes, I only got 6 of them.
Could you please give me a code example of how to do this?
Thanks,
>The Dir function isn't guaranteed to return the files in any specific order.
>
[quoted text clipped - 6 lines]
>> "0707"
>> to "0709" and skips "0708". any ideas?

Signature
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
Douglas J. Steele - 20 Mar 2008 19:20 GMT
Your code snippet should work: there's no other code that I could give you!
The only change I'd make is to replace
Do While strFileName <> vbNullString
with
Do While Len(strFileName) > 0
Exactly what are you doing in the
' Do stuff here
section?

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Doug,
>
[quoted text clipped - 16 lines]
>>> "0707"
>>> to "0709" and skips "0708". any ideas?
ragtopcaddy - 20 Mar 2008 19:47 GMT
Doug,
I can't for the life of me see how this code could possibly work.
There is no equivalent to ".MoveNext" or "Next strFileName" or anything.
How could it possibly loop through a list of 12 files when there is no
apparent mechanism to do so?
Thanks,
>Your code snippet should work: there's no other code that I could give you!
>
[quoted text clipped - 17 lines]
>>>> "0707"
>>>> to "0709" and skips "0708". any ideas?

Signature
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
Douglas J. Steele - 20 Mar 2008 21:26 GMT
From the Help file:
"Dir returns the first file name that matches pathname. To get any
additional file names that match pathname, call Dir again with no arguments.
When no more file names match, Dir returns a zero-length string (""). Once a
zero-length string is returned, you must specify pathname in subsequent
calls or an error occurs."

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Doug,
>
[quoted text clipped - 29 lines]
>>>>> "0707"
>>>>> to "0709" and skips "0708". any ideas?
> Here's my code:
>
[quoted text clipped - 7 lines]
> The problem is, the files are skipping around. The filename goes from "0707"
> to "0709" and skips "0708". any ideas?