|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
digit problems! Please help!
Hi there Everyone!
I have the following problem, please try tol help if you can! I am a (very) lame newbee and I can't code!!! Please explain how could I solve this problem! I try to make the Customer ID (which is also the primary key and it is set to autonumber) to look like this 0001, 0002, 003,.. 0009, 0010,0011… 0100, 0101.. and so on. On the format of the Customer ID I wrote this:”>> 0000” (without quotations) My problem is that this autonumber should work this way: 0008, 0009, 0010, 0011. But this way unfortunatelly it works this way: 0008, 0009, 00010, 00011. I hope you understand my problems. What’s wrong?? Thanx a lot in advance! |
|
#2
|
|||
|
|||
|
In that case you have to use a condition (nested if else or case statement). I think thats the only way you can control the data.
In your example you have 0008,0009,0010 which is supposed to be the output but instead you get 00010. The reason is you add 3 zeros(000) which gives a 5 digits number in return. Eg. 10 will surely display 00010 not 0010. try the following 'num variable holding the length of the data 'result final output select case len(num) case 2 result = "000" & num case 3 result ="00" & num case 4 result = "0" & num end select Cheers |
|
#3
|
|||
|
|||
|
where should I paste it?
Thanx a lot for your answer but please also tell me where should I paste the following code because I dont know where should I paste it!
select case len(num) case 2 result = "000" & num case 3 result ="00" & num case 4 result = "0" & num end select |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > digit problems! Please help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|