Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Table with 5 digits

Status
Not open for further replies.

Lightlancer

Programmer
Jul 18, 2008
88
NL
Hi there,

i have a table with a field with numbers

1 to 9999 (something like that)


well all numbers must be 5 digits, so 1 would be 00001

and 9999 would be 09999

i could change it manualy but the table has more than 10000 records.

Is there a faster way to do this??
if so can someone please give me a very good manual????

Thanks in advance
 
What do you want this for? It is easy enough to display a field in five digits and this display can also be exported.

Format(ThisField, "00000")
 
Run an update query:

UPDATE table
SET field = format (field, "00000")

This assumes that the numbers are stored in text fields; if they are stored in numeric fields then you can acheieve the same effecy by putting 00000 on the format property, and can't store leading zero's in the field.

John
 
Hi,

I tried both, in a update query but they dont work.
i need this because every record has a word document attached. and because we store old documents asswell the database decide what document is the newest, and then opens the document. well we got alot of those document and the format of the name is like this:

07263.003.doc

07263 stands for the recordnumber
003 stands for the version (001 is the oldest, 003 is the newest)

its to much work to change all the documents.......


Greetz
 
Try something like this:

FollowHyperlink "C:\Path\to\Docs\" & Format(NameOfFieldHere,"00000") & "." & Format(NameofVersionFieldHere) & ".doc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top