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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Problem

Status
Not open for further replies.

md092686

IS-IT--Management
Jul 20, 2007
18
0
0
US
I have a Store Number that is in a table 001 in file1 and I have Store Number as 1 in another file2. I want to change all of the store Numbers in File2 to 001 until you reach Store 10 by placing two zero's to the left of 1. Now when the number changes to 10 I need for the number to have only 1 zero to the left of the number such as 010. Is there a quick and dirty way to do this with an update query?

Thanks

md092686
 
This will only work if you are storing the field as a text....and not as a number.

Code:
UPDATE Table2 SET Table2.Name = Format([Name],"000");

If the value is a number, you can use that same Format on your forms or reports to just change the "display" so they appear to have the leading 0s.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top