Yes I agree within itself the auto number would normally be a unique
identifier. And if I were not building in a measure to insure duplicate
records were not loaded I could use just that. But Trust me when I say I
can’t.
If it were as simple and load a file add an auto number to it and be done
with it I would be very very happy. But not the case here.
Here is my example
For background on the data lest say within the data he loaded lets say there
are 4 fields Name, customer number, type of transition, and date of
transaction.
Now a customer can and normally do have more than one type of transactions a
day so there is the possibility that a name and subsequently the customer
number will occur twice. In fact within those fields there are no unique
Identifiers. There can be duplicate types of transactions, customer can have
the same type transactions in the same day So within this file there are No
unique Identifiers. However the next days transactions will be unique to
that day so from file to file one can say ‘For that File as compared to
another file the Date is Unique. (not unique records but unique to the
file).
But at the end of the day with the 4 available fields there is not
combination of fields that would give me a unique field.
Now lets put it into motion
Example:
Little Johnny loads a file in the database, it is all transactions that
occurred on Dec,1,2008. We will say that is 10 records. I use the method
you suggested an load it up and sure enough I now have 5 fields with a unique
number to each field. So numbers 1 – 10 Zulu Bravo Wooo hooo.
Now lest say Little Johnny goes out that night and gets Drunk as hooter
Brown and comes to work the next day with a Buzzzzzzz on. He is tired and
not paying attention so he grabs the same file he loaded yesterday and loads
it again today. 10 records Ten loads 11 – 20 are now assigned to the files
and access gladly take them in.
BUT WAIT I now have Duplicate records. But Drunk Johnny don’t know that,
and most importantly ACCESS does not catch the Drunken Johnny’s mistake. Now
Customers are billed twice, accounting is mad, The database is corrupt, Man
no good news there. Clearly that is undesirable. So using access adds number
feature alone does not work here. What to do what to do. Hummmm
Lets Try this.
Little Johnny loads a file in the database, it is all transactions that
occurred on Dec,1,2008. We will say that is 10 records. Several business
rule are applied and what I end up with is a table with the 10 records and a
field named Unique ID with text like Dec,1,2008-1 ~~~~~~~ through Dec,1 2008
-10. Ok so now bravo zulu No duplicates looking good so far.
Now lest say Little Johnny goes out that night and gets Drunk as hooter
Brown and comes to work the next day with a Buzzzzzzz on. He is tired and
not paying attention so he grabs the same file he loaded yesterday and loads
it again today. 10 records Ten loads However now that I have the auto
number reset to one when the number gets added in Instead of getting
Dec1,2009 11 though 20. I get Duplicate records or Dec-1-2008-1 through
Dec,1,2008-10. Business rules are applied and it is attempted to save these
duplicates in a subsequent table the table says NO WAY DRUNK Johnny you cant
have duplicate records. It rejects the files sends a Message box error
saying “Hey Drunk Johnny, you cant load this file again. Try using the
right file.†Johnny realizes his mistake loads the right file. Now the
customer his happy because they are not billed again, Accounting is happy
because it does not add bad info to the DB, The DB is not corrupt , and
little johhny saves his job.. IN fact all are happy because there are no
duplicate records. Much better outcome than above.
So now that I have proven a legitimate reason to wanting access 2003 auto
number to reset to 1 could you please pass along how to do that.
Thanks
Andy