View Full Version : Number Field


sandrao
05-02-2008, 09:26 AM
How can I have a number field behave like the auto number function?

I saw somewhere that through code you could have the number field increase each record by 1.

Any ideas?

pbaldy
05-02-2008, 09:36 AM
It is often done using a DMax:

NewNumber = Nz(DMax("NumberField", "TableName"), 0) + 1

sandrao
05-02-2008, 09:41 AM
Where would I place the Code? In the actural number field? In the Form?

pbaldy
05-02-2008, 09:45 AM
Sort of depends on the specifics of your application. If you search on DMax here you'll probably find several discussions on this topic. It comes up pretty often.