dmax on continuous forms

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top