R
rb608
I'm in the process of creating a form to allow me to more quickly
catalog & caption some photos; and for a novice VB user, I'm doing
okay I guess. I have set up fields for the image path, prefix,
sequence number, and file type. e.g.
Path = C:\MyDocuments\MyPhotos\Vacation\
Prefix = ThemePark
Sequence = 001
File type = .jpg
By concatenating all of these fields, I can have the form pull up the
image file with Me!frmImgFile.Picture = Me!txtPath & Me!txtPrefix & Me!
txtSequence & Me!txtFiletype.
So far, so good.
Then I got to where I wanted to have the form step to the next image
sequentially, by adding 1 to the txtSequence field, so I changed the
sequence field format from text to number. Here's where I hit the
limits of my knowledge.
The file names in the image folder have a three-digit format, i.e.
ThemePark001.jpg, ThemePark002.jpg, etc. In concatenating the
sequence number, I'm stuck on how to force that three-digit format in
the concatenation so that I don't get ThemePark1.jpg when I need
ThemePark001.jpg.
I've considered the "blunt instrument" approach of concatenating a
zero or two depending on the magnitude of the sequence number, but I'm
thinking there must be something more elegant and simple.
TIA,
Joe F.
catalog & caption some photos; and for a novice VB user, I'm doing
okay I guess. I have set up fields for the image path, prefix,
sequence number, and file type. e.g.
Path = C:\MyDocuments\MyPhotos\Vacation\
Prefix = ThemePark
Sequence = 001
File type = .jpg
By concatenating all of these fields, I can have the form pull up the
image file with Me!frmImgFile.Picture = Me!txtPath & Me!txtPrefix & Me!
txtSequence & Me!txtFiletype.
So far, so good.
Then I got to where I wanted to have the form step to the next image
sequentially, by adding 1 to the txtSequence field, so I changed the
sequence field format from text to number. Here's where I hit the
limits of my knowledge.
The file names in the image folder have a three-digit format, i.e.
ThemePark001.jpg, ThemePark002.jpg, etc. In concatenating the
sequence number, I'm stuck on how to force that three-digit format in
the concatenation so that I don't get ThemePark1.jpg when I need
ThemePark001.jpg.
I've considered the "blunt instrument" approach of concatenating a
zero or two depending on the magnitude of the sequence number, but I'm
thinking there must be something more elegant and simple.
TIA,
Joe F.