Table Format (1 Viewer)

Cat

Registered User.
Local time
Today, 06:50
Joined
May 8, 2002
Messages
19
I have a table that list Area codes.
EX: E1, E11, E12, E2 etc.

When I put them in order E11, E12, etc. comes before E2, E3, etc.

How can I format the table to insert a "0" so I get Area E01, E02, etc. - so the sort order will be correct?

Thanks from a junior Access user.
 

pdx_man

Just trying to help
Local time
Yesterday, 22:50
Joined
Jan 23, 2001
Messages
1,347
Couple different things you can do. First off, just build a query and base your Forms/Reports off of it instead of the table. Then you can have a statement that extracts the numberic portion out, then sort by it:

Adj_Field: CInt(Mid([field1],2))

But if you want the leading zeros:

Adj_Field: Left([field1],1) & Format(CStr(Mid([field1],2)),"000")

But if you want to update the base table. then create an Update query and put the above statement in the Update To row.

Left([field1],1) & Format(CStr(Mid([field1],2)),"000")


HTH
 

Users who are viewing this thread

Top Bottom