I am using the following code to generate a sequence number. It works, but my issue is that it starts numbering on the second record. IE: record two shows a 1; record three shows a 2, etc. Can some one tell me how to make the first record show a 1, etc?
Dim DtlSRecipIDCurrent, DtlSRecipIDPrevious As Variant
Dim DtlSPayToProvCurrent, DtlSPayToProvPrevious As Variant
Dim RecipSeqNumber As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
DtlSPayToProvCurrent = Me.txtDtlSPayToProvID
DtlSRecipIDCurrent = Me.txtSRecipOrigID
If DtlSPayToProvCurrent = DtlSPayToProvPrevious Then
If DtlSRecipIDCurrent <> DtlSRecipIDPrevious Then
RecipSeqNumber = RecipSeqNumber + 1
End If
ElseIf DtlSPayToProvCurrent <> DtlSPayToProvPrevious Then
RecipSeqNumber = 1
End If
Me.txtSRecipSeqNum = RecipSeqNumber
'Me.txtSRecipSeqNum = 3
DtlSPayToProvPrevious = DtlSPayToProvCurrent
DtlSRecipIDPrevious = DtlSRecipIDCurrent
Thanks for you help.
Bill
Dim DtlSRecipIDCurrent, DtlSRecipIDPrevious As Variant
Dim DtlSPayToProvCurrent, DtlSPayToProvPrevious As Variant
Dim RecipSeqNumber As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
DtlSPayToProvCurrent = Me.txtDtlSPayToProvID
DtlSRecipIDCurrent = Me.txtSRecipOrigID
If DtlSPayToProvCurrent = DtlSPayToProvPrevious Then
If DtlSRecipIDCurrent <> DtlSRecipIDPrevious Then
RecipSeqNumber = RecipSeqNumber + 1
End If
ElseIf DtlSPayToProvCurrent <> DtlSPayToProvPrevious Then
RecipSeqNumber = 1
End If
Me.txtSRecipSeqNum = RecipSeqNumber
'Me.txtSRecipSeqNum = 3
DtlSPayToProvPrevious = DtlSPayToProvCurrent
DtlSRecipIDPrevious = DtlSRecipIDCurrent
Thanks for you help.
Bill