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

Custom format values

OCM

MIS
Sep 12, 2002
226
US
Greetings,
Currently in office 365 ms access, I have two fields CustID & LOC formatted as number data types in access table. As a result, the leading zeros are not displayed in the access form. CustID is a seven digit # and LOC is a 2 digit #.

I'm familiar with changing the data type as text and/or formatting as "0000000" and "00". But, this changes existing entries. I was wondering if there is a way not to retro update, but apply the changes moving forward.

TIA

Regards,
 
It seems to me that the simplest way would be to add 2 more columns for the text representation that you desire, then going forward fill the text columns, leaving the numerical columns empty. When you need a value, check the text column for with/without value. If it has a value, use it, but if the text is empty use number type.
 
Hi,
Thank you for the reply post. If I understand it correctly, I would create two new text fields and replace the old numeric fields on my forms/queries/reports etc. so that end users will be able to include the leading zeros, correct?
The question I have is as an admin, when searching and/or updating records, does this mean I have to search in multiple places?

There is no other way to only start formatting the fields as text moving forward only, but not retro update old records?

TIA,

Regards,
 
So, exactly how are you displaying the data now? Numeric fields directly from your numeric data (with the resulting anomalies)? Text fields with manipulated data from your numeric data (with no anomalies)? How many screens display this data? Can you change the screens? Are you looking to create new screens where the data is only displayed as text while keeping the old screens unchanged?

Based on your answers what I suggested earlier may or may not work for you.
 
HI,
The person who designed the DB formatted the field as number. To answer you question, how the data are display now?
it is: Numeric fields directly from my numeric data (with the resulting anomalies).

e.g.,
0123456 is displayed as 123456, 0012345 as 12345 etc.

TIA

Regards,
 

Part and Inventory Search

Sponsor

Back
Top