I am trying to create a sequence number that will count up by 1 based on the selection of a combo box. My table looks like this. Named Table1
IRType EDate IR_No
CA 3/1/14 1
CA 3/6/14 2
CI 3/7/14 1
PA 3/7/14 1
CI 3/8/14 2
CA 3/8/14 3
PA 3/9/14 2
So every time an IRType selection is made on data entry form the IR_NO populates with the next corresponding number. I have tried the following code but can not seem to get it to work.
Private Sub Form_Click()
If Me.IR_No = 0 Or IsNull(Me.IR_No) Then
MeIR_No = Nz(DMax("IR_No", "Type", "Table1"), 0) + 1
End If
End Sub