View Single Post
  #4  
Old October 9th, 2004, 03:05 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default

On subsequent calls of Dir, if you use no arguments, you'll get the next
file in line. So, you need to know if you've been through once already. In
your case, you could probably use the fact the txtCurrentName has a file
name in it instead of the "flag" variable that I've used. I assume
txtCurrentName would be blank until you get the first file.

Example:
Private Sub Command3_Click()
Static bolBeenHere As Boolean
If bolBeenHere Then
Me.Text4 = Dir
Else
Me.Text4 = Dir("c:\windows\*.*")
End If
bolBeenHere = True
End Sub

--
Wayne Morgan
MS Access MVP


"j.t.w" wrote in message
om...
Wayne,

Thanks for your response.

I understand that the "If" statement will skip the renaming of the
file, but what I would like to do next is move to the next tif file in
the directory without having to do anything with the current tif file.

Example of contents in the directory (in this order):

SCN_11111111111.tif
SCN_22222222222.tif
SCN_33333333333.tif
SCN_44444444444.tif
etc.

Currently, when I rename and move the files as they are being
displayed, the next image gets displayed where I can then rename that
one. How would I go about looping through the directory and skipping
the "SCN_33333333333.tif" image and then move on to the
"SCN_44444444444.tif"? Note: Prior to the file being displayed, I
wouldn't neccessarily look at or know what image I would like to skip
until that time.

Anyway, hopefully I explained this well enough. Please let me know if
you need more information.

Thanks.
j.t.w