Solved auto number id format on vba

Akai90

Member
Local time
Today, 20:23
Joined
Feb 8, 2022
Messages
67
hi again

Code:
Private Sub NoPermit_GotFocus()
NoPermit = "XXXX/xxx/xxx/xxx." & tahundaftar & "/" & noidtext & ""
End Sub

above my code
noidtext = this item i use format "0000"
Untitled.png


on noidtext on left i want using 0003

how can i get 0003

thaks
 
Code:
... & "/" & Format(noidtext, "0000")
Use the Format function. This creates a string and thus a new value, whereby the zeros are then also fixed.

In contrast, the Format property of a text box is in a table or query view or in form and report controls. The property only displays the format externally, but the real value remains as it is, for example 3 as an integer.
 

Users who are viewing this thread

Back
Top Bottom