Increment

M

mushy_peas

Hiya folks.
i noob at acess so dont be too mean.

Trying to produce a form and got a few problems.

Main one is theres a "log number" which every time a new record i
started auto increments by 1 from the previous.

Cheer
 
A

Allen Browne

You could use an AutoNumber field.

If you want to code it yourself, use the Before Update event procedure of
the form to lookup the maximum value so far in the table, and add 1:

Me![log number] = Nz(DMax("log number", "MyTable"), 0) + 1

Note that this is not 100% safe in a multi-user environment where more than
one person may be adding records at the same time.
 

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