Access choppes zeros when I combine fields of a table

DKpitbull

Registered User.
Local time
Yesterday, 22:32
Joined
Mar 11, 2014
Messages
21
Hi all!

I have this problem two days now and couldn't find any relevant answer to my problem..anyway..

I have a table "MansComps" which includes two fields, the "Index" field which contains a number, e.g "5" and the "Tabletype" field which contains a letter e.g "T". i have created a query based on this table, which combines these two fields and displays the result to a third field which I call "Components".

So my query has..

field: Index
1, 2, 3,....

field: Tabletype
T

field: "Component" has to be like this:
T00001, T00002,...

I have managed to combine the fields in my query using the expression:

Component: [Tabletype] & " " & [Index]

but the results appear without the leading zeros, like T1, T2...

I have set my Index content to be a number and as a primary key and the Tabletype as a text. I also tried to change the format of Index to "00000" which works for the Index field separately but not for the Component field.
Should I do something in the format of the Component field?

Thanks!
 
Hi namliam and thanks for your reply! Where should I write this command? I tried it in the format area of the "Component" field in the query, but something goes wrong as Access itself alternates the expression to "For"m"at([I"nd"ex], 00000)" , so prabably I'm doing something wrong.
 
Component: [Tabletype] & Format([Index], "00000")
 

Users who are viewing this thread

Back
Top Bottom