I have a Sales form which needs to automatically enter a TransactionID. I want the number entered to be in the format of 2002-### )the second portion being the next sequential number.
In [Sales.TransactionID] I have set the input mask to >0000\-00;0
The field name on the form is [TransID]
In the OnCurrent property of the form, I have the following code:
Private Sub Form_Current()
If Me.NewRecord = True Then
If IsNull(DMax(Sales.TransactionID)) Then
TransID = Right(Year()) + DMax(Sales.TransactionID)
Else
TransID = Sales.TransactionID
End If
End If
End Sub
PLEASE HELP! I really got myself into a pickle trying to figure this out!
In [Sales.TransactionID] I have set the input mask to >0000\-00;0
The field name on the form is [TransID]
In the OnCurrent property of the form, I have the following code:
Private Sub Form_Current()
If Me.NewRecord = True Then
If IsNull(DMax(Sales.TransactionID)) Then
TransID = Right(Year()) + DMax(Sales.TransactionID)
Else
TransID = Sales.TransactionID
End If
End If
End Sub
PLEASE HELP! I really got myself into a pickle trying to figure this out!