Dear All,
In my asset Database, there is a variable called CIAT in Asia Code, this field has been formated as text. Currently, I am changing it so that everytime user add new record on to a database it can increasingly auto fill a new record. after writting a code (refer to the following) it only fills the last three numbers e.g 875 skipping two zero number at the front.
Here is the code applied:
Private Sub Form_Current()
If Me.NewRecord Then
On Error Resume Next
Me!txtCIATAsiaNo.DefaultValue = Nz(DMax("[CIATinAsiaCode]", "Assets"), 0) + 1
Me.cmdDud.SetFocus
Else
Me.cmdDud.SetFocus
End If
End Sub
Question is: Would that be any possibility to combine those two zero and three numbers together such as 00875 ... as new record are added.
Thank you so much in advance for great help.
In my asset Database, there is a variable called CIAT in Asia Code, this field has been formated as text. Currently, I am changing it so that everytime user add new record on to a database it can increasingly auto fill a new record. after writting a code (refer to the following) it only fills the last three numbers e.g 875 skipping two zero number at the front.
Here is the code applied:
Private Sub Form_Current()
If Me.NewRecord Then
On Error Resume Next
Me!txtCIATAsiaNo.DefaultValue = Nz(DMax("[CIATinAsiaCode]", "Assets"), 0) + 1
Me.cmdDud.SetFocus
Else
Me.cmdDud.SetFocus
End If
End Sub
Question is: Would that be any possibility to combine those two zero and three numbers together such as 00875 ... as new record are added.
Thank you so much in advance for great help.