How do I auto number using 01, 02 instead of just 1, 2 etc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working w/jpeg files that are associated w/my database. I need to store
the jpegs using 01,02, etc. as file names. I have a VBA code that links the
Item No. to the Jpeg file name and runs a report w/data and a photo.

I can't get Access to let me number the items using the same numbers. It
only allows for 1, 2, etc. I don't want to store 2 sets of photos just
because of file names. Can someone help me renumber the DB?
 
You can't use autonumbers reliably for this. You will develop gaps that
cannot be recovered and you can't format them either. The best way is to
create your own numbering scheme. On my website
(www.rogersaccesslibrary.com), there is a small Access database sample
called "AutonumberProblem.mdb" which uses the DMax() function to find the
highest number existing in a table and add 1 to it. With a little bit of
adaptation, you should be able to make it work in your case.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
paste2 said:
I'm working w/jpeg files that are associated w/my database. I need
to store the jpegs using 01,02, etc. as file names. I have a VBA
code that links the Item No. to the Jpeg file name and runs a report
w/data and a photo.

I can't get Access to let me number the items using the same numbers.
It only allows for 1, 2, etc. I don't want to store 2 sets of photos
just because of file names. Can someone help me renumber the DB?

Using autonumbers where people will see them is a bad idea. Autonumbers
are designed to provide unique numbers and that is all. Sometimes they are
in order, but don't bet the farm on it. Follow Rogers advice.
 
Back
Top