Hello, I have a subform that I want to enter a number each time I enter a new record. I have it working i.e. say on 4098544.02 it will number 01, 02, 02, etc. However if I change to a different record say 30499000-01 then I want it to restart the numbering sequence again from number 01. This is what I have so far, I am just starting out in VBA. Please be patient with me lol
Private Sub cmdSubAddNew_Click()
DoCmd.GoToRecord , , acNewRec
Dim WorkOrderNbr As String
WorkOrderNbr = Form_frmIWLEntry.WorkOrderID
If Me.NewRecord Then
Me.ItemNumber = Nz(DMax("ItemNumber", "tblIWL"), 0) + 1
End If
End Sub
Private Sub cmdSubAddNew_Click()
DoCmd.GoToRecord , , acNewRec
Dim WorkOrderNbr As String
WorkOrderNbr = Form_frmIWLEntry.WorkOrderID
If Me.NewRecord Then
Me.ItemNumber = Nz(DMax("ItemNumber", "tblIWL"), 0) + 1
End If
End Sub