Default value in a table

mihabaki

Registered User.
Local time
Today, 22:21
Joined
Jul 14, 2005
Messages
48
Hello,

I have a field named dblNumber and I want it's default value to be it's value in the previous record + 1. How can I do this ? If it's not possible in a table, can I do it on a form?

op.: I don't wan't to use the "autonumber" option...

thanks
m.
 
You could use a dmax() to see what the last number is. But I think I would store the value in a system table and increment/reference each time...
 
Thanks for the help.

I created a max query and I retrieve it's last number with "dlookup" on a form and just use " +1" for my field...

m.
 
just one more thing:

if I use the autoincrement in a field (system table) is there any way that I don't get any missing values ???

e.g. I start with 1 then, 2, 3, 4, 5, I then delete the record with the "5" and I would like the next record to be "5" again not "6" !
 
You have to use the compact & repair database command to do this
 

Users who are viewing this thread

Back
Top Bottom