Showing last record

P

Pango

I have a form named Notes and has a field named [NoteNumber] .when it opens it takes the user to add a new note. But I want to have a testbox where i want to display the last note number. What sould be the code for that

Any help is appreciated?
 
A

Arvin Meyer

Probably the easiest way is to use DMax(). If your number is a true number
(not text) the code would be something like (aircode):

Sub Form_Open()

Me.txtNoteNumber= DMax("NoteNumber", "YourTableName")

End Sub

Pango said:
I have a form named Notes and has a field named [NoteNumber] .when it
opens it takes the user to add a new note. But I want to have a testbox
where i want to display the last note number. What sould be the code for
that?
 
Top