Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Number by VBA

Status
Not open for further replies.
Jul 31, 2003
7
0
0
US
I have created a database that has many links to Oracle. The problem is when I add a new record, neither Access or Oracle allows for the primary key to be an auto number. So... I was able to create a macro that before update looks at a form, takes the max number and adds one, then set the number to the control my main form. It then goes to previous record and then goes to next record in order for Oracle to save the record.

Is there a way to do this in VBA on the form? My option works fine, but makes the application flicker as it jumps from place to place. Plus if two people are in at the same exact time, it creates 2 records with the same primary key.

Thanks.
 
Get the Access [version number] Developer's Handbook. It's worth three times what you could pay for it, easily. It's got code to do this and a zillion other things.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Professional Development for Clients Large and Small

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top