Apple wrote:
May anyone can teach me to assign a autonumber, I want to create a
number that is starting with year (auto change to year 2006) +
autonumber (eg. 2005-1001, 2005-1002 and so on)
Apple,
As Rog so eloquently said, to not use the Access autonumber system.
While I have never had any problems with it, I continue to read from
well informed developers to not use it. Better to use a unique table
to store your record numbers in. If you wish to creat a number with
the year, you can steal the clock date and place it into a memory
variable. Then read the top number from your unique number table.
Place that value into another variable. The third variable will
combine the values from the first two in the format you wish. I built
one in 1999 that reads the clock date, format out the last two digits
of the year, read the top number of the record table, marry the two
values and display it in text box that is not allowed to be modified by
the user. This way the number values continue correctly. Then the
form into which they input the record into the datebase is modal and
the only way out is to click on the OK or the Cancel button. If the
Cancel button is used, the number is not stored anywhere. The number
is stored only when the OK button is clicked and certain fields are
dirty. You can do what you want here. I hope this is some help for
you to get started either producing or ask more questions.
FlSteve