dmax on continuous forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using dmax for my autonumber field, works great with single form view.
However, I'd like to have some forms as continuous but when I do this, the
"fake" autonumber doesn't seem to work, it only carries the previous number
over.
I'm using OfficeXP.

Thank you in advance
 
Try this code in your forms on current event:

Private Sub Form_Current()
If NewRecord Then
Me.Line_No = Nz(DMax("[AutoNumFieldName]", "My_Table_tab", ""), 0) + 1
End If
End Sub
 
Back
Top