Access with Teradata backend Need to simulate AutoNumber


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!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You would use something like:

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.
c9k9hAuthor Commented:
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?
'the Form_Beforeupdate event procedure'

Display the form properties and in the event properties click into the BeforeUpdate event. Choose EventProcedure from the list. Clicjc the Build button (...) to the right and you are where the code needs to go.

Obviously you must use your own object/field names.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

c9k9hAuthor Commented:
You know peter, you really are a genius :)

works perfectly!
c9k9hAuthor Commented:
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.