coding problem

rashidzaib

Registered User.
Local time
Today, 08:38
Joined
Aug 12, 2007
Messages
32
hy
i hope all r fine
i am making item code through access form to help my erp program
the detail of coding is we have 13 digit code and to make an item we have five group
example

first group contain 4 digit 1001
2nd group 3 digit 001
3rd 2 digit 01
4th 2 digit 02
5th 2 digit 03


the item will be to concatenate the all group that is
1001001010203
this will be my item code
here the problem is when i am making group code if code is 001 access is giving me 1 and i want the group code to be autonumber

is there any solution please help me.
thank u in advance
bye
 
hy
i hope all r fine
i am making item code through access form to help my erp program
the detail of coding is we have 13 digit code and to make an item we have five group
example

first group contain 4 digit 1001
2nd group 3 digit 001
3rd 2 digit 01
4th 2 digit 02
5th 2 digit 03


the item will be to concatenate the all group that is
1001001010203
this will be my item code
here the problem is when i am making group code if code is 001 access is giving me 1 and i want the group code to be autonumber

is there any solution please help me.
thank u in advance
bye

For your purpose do NOT, I repeat, do NOT use autonumber. You should use DMax to find the last number and increment it by one. An autonumber should, in most cases, NOT be used for cases where meaning is assigned. An autonumber ONLY guarantees a UNIQUE number, not incremental numbers.

However, if you can live with an autonumber that may not be sequential, or have spaces between the numbers (if someone starts a record and then cancels that autonumber is gone forever) then you might be able to use it. But if you want incremental numbers in sequence without missing numbers (except if something is deleted) then you should look on the site here for how to use the DMAX function.
 
hy thank u very much for reply
ok if i not use autonumber but how can i solve the problem of code 001 it is coming 1
if i am entering 0012 it is coming only 12
any help should realy be appriciated
thank you
 
Set the format on the field to

0000

but, you'll have to do that everywhere you use it. So, anytime you need it in a query, form, report you will need to set the format to 0000
 

Users who are viewing this thread

Back
Top Bottom