Next available number

rgreene

Registered User.
Local time
Today, 11:05
Joined
Jan 22, 2002
Messages
168
I have an ID field that I want to function basically like an autonumber field. I don't want it to be an autonumber field because I want to pick the starting number. So I'd like to have it give me the next available number in sequence when I click a button.

If I can assign a starting number with autonumber that would work too. I want my starting number to be either 0001 or 1000. I haven't decided yet. Autonumber starts with 1 I need the preceeding 0's

So if I have records 0001, 0002, 0003,...0012 I would like to click a button and have it fill in 0013. Next time I click the button it would be 0014 and so on.

Thanks,
Rick
 
It would strongly suggest that you reconsider what you are doing.

Use autonumber for your primary key.

If you want some other field that has leading zeroes and starts with 40000 or whatever, then create a field to do that.

You can use DMax to find the max number in a column of a table, DMax(MyField) + 1 will give you the next number.

Hope this helps,
 

Users who are viewing this thread

Back
Top Bottom