auto number format on form (1 Viewer)

Akai90

Member
Local time
Tomorrow, 02:25
Joined
Feb 8, 2022
Messages
65
hai,

i have set my auto number format as "00000" so my auto number will be 00001,00002

but on form textbox auto number still use 1, 2, 3

example for wat i want to do
TGuruIPS.noid = IS AUTO NUMBER
tahundaftar = year
output
ZXCV/XXX/CC/AAA.2022/00001
ZXCV/XXX/CC/AAA.2022/00002
ZXCV/XXX/CC/AAA.2022/00003

my vba for autofocus
NoPermit = "ZXCV/XXX/CC/AAA." & tahundaftar & "/" & TGuruIPS.noid & ""

but when i run autofocus
my output is like this
ZXCV/XXX/CC/AAA.2022/1
ZXCV/XXX/CC/AAA.2022/2
ZXCV/XXX/CC/AAA.2022/3

table format
Untitled.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:25
Joined
Oct 29, 2018
Messages
21,474
Did you also format the Textbox on the form?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:25
Joined
May 7, 2009
Messages
19,245
create a query and Format the Year and permit number in New Calculated column:

select *, "ZXCV/XXX/CC/AAA." & tahundaftar & "/" & Format(TGuruIPS.noid, "00000") As NoPermit from TGuruIPS

use this query in your form.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:25
Joined
Feb 19, 2013
Messages
16,616
part of autofocus fields not follow 00001
As an explanation, the format is just a view of the underlying data. Whenever you reference that data you will get the underlying value, not the formatted value.

Also, I presume you are aware that autonumbers are fine for their purpose which is to uniquely identify a record - but should not be relied on for any other purpose which requires meaning and no gaps in the sequence. You will get gaps in autonumbers when a record is deleted and when a record starts to be created and is then abandoned.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 19:25
Joined
Sep 12, 2006
Messages
15,657
Seriously, you can't store a number 1 as 00001. You can't have both a number 00001 and 0001, as they are both representations of the same number, number 1. You can have a string "00001" but then it's no longer a number, and you can't manipulate it as a number. You also can't extend decimal points. 1.0,1.00, 1.000 are all the same, although with real numbers, you can get some representation issues, as not every real number can truly be stored in binary.

You need to be familiar how numeric values are processed/managed. It's not quite clear to me precisely what you are trying to achieve.
 

Users who are viewing this thread

Top Bottom