c9k9h
asked on
Access with Teradata backend Need to simulate AutoNumber
Hello,
I have recently swapped the back end of a database from the access .mdb to a Teradata table. I'm running into a problem with this seeing as Teradata does not offer an autonumber data type. Is there anyway I can use something as a substitute? My current column for the autonumber is the RequestID I've tried creating a field on the form for this id and doing something like RequestID = RequestID + 1 (and the likes) with no success.
Any ideas would be GREATLY appreciated!
Thanks in advance!
I have recently swapped the back end of a database from the access .mdb to a Teradata table. I'm running into a problem with this seeing as Teradata does not offer an autonumber data type. Is there anyway I can use something as a substitute? My current column for the autonumber is the RequestID I've tried creating a field on the form for this id and doing something like RequestID = RequestID + 1 (and the likes) with no success.
Any ideas would be GREATLY appreciated!
Thanks in advance!
ASKER
No there will be no need to see the number whatsoever... its strictly to have a unique ID.
what sub would i put the me.txtrequestid = Dmax("RequestId", "tablename")+1 in?
what sub would i put the me.txtrequestid = Dmax("RequestId", "tablename")+1 in?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You know peter, you really are a genius :)
works perfectly!
works perfectly!
ASKER
Excellent answer, worked perfect!!!
I'm afraid that on EE 'Genius' status is as much a function of time as it is of ability.
The really clever ones only stay a short while, amass a stack of points and then move on.
But thanks anyway.
The really clever ones only stay a short while, amass a stack of points and then move on.
But thanks anyway.
me.txtrequestid = Dmax("RequestId", "tablename")+1
Unless you have a need to see the number then I would put this code in the Form_Beforeupdate event procedure, so that it is only allocated as the record is saved. Otherwise you will have to save the record as soon as the number is obtained to prevent another user from using the same number.