Concatenate

G

Glenn Brown

I have a autonumber formated like 000001 and I'm concatenating it with a 4
alpha text field so I end up with something like TEST000001.

I've created a calculated field in the forms record source with the
following: -
SalesLedgerCode: [strSalesLedgerShortcode] & [lngSalesLedgerCodeID]

The result is TEST1 instead of TEST000001. The field in the table is
formated as 000000.

Could some please help out.
Thanks
Glenn
 
F

fredg

I have a autonumber formated like 000001 and I'm concatenating it with a 4
alpha text field so I end up with something like TEST000001.

I've created a calculated field in the forms record source with the
following: -
SalesLedgerCode: [strSalesLedgerShortcode] & [lngSalesLedgerCodeID]

The result is TEST1 instead of TEST000001. The field in the table is
formated as 000000.

Could some please help out.
Thanks
Glenn

A Number datatype value is never saved with leading zero's. A value of
000004 is the same value as 4.
A Field's format is just how it displays the field, not how the data
is actually stored.
Use:
SalesLedgerCode: [strSalesLedgerShortcode] &
Format([lngSalesLedgerCodeID],"000000")
 
Top