Solved

Access Auto-number with multiple users

Posted on 1998-04-08
3
169 Views
Last Modified: 2006-11-17
I have an App that's recently gone from single user to mulit-user, I have a form based on a query and the ID number in the query is an Auto-number field, when a user goes into the form and clicks the new record button they get the word Auto-Number in the ID field, only when they change another control on the form does it allocate an actual number, if two people click the button at almost the same time, i.e. they click it then don't update a control before the other person clicks new record, they bothe get the same ID number, hence th elast person out overwrites the first persons edit.  What is the best way to handle this, I thought of writing some code to do the same thing as autonumber?? Any Suggestions.
0
Comment
Question by:nmcdonne
3 Comments
 
LVL 7

Expert Comment

by:spiridonov
ID: 1973650
You can create a table (table_name,next_number_for_this_table) and lookup and update this table whenever user adds a new record
0
 
LVL 6

Accepted Solution

by:
devtha earned 50 total points
ID: 1973651
Hi, NMC
One way of solving is to do it the way spridonov has described. Another way is to check for the last record's number in the table and then new number is = foundnumber + 1.
Use Dlast(          ) expression.
on Form's properties change the lock property to edited record.
I hope this helps.
Devtha




0
 
LVL 2

Expert Comment

by:marti
ID: 1973652
You could try to explicitly change one of the controls to something like "" or " " when New botton is click to get the ID right away.
Otherwize you still can use the Spiridonov suggestion. Be sure to lock the table before starting the  process of getting the new ID.
Spiridonov, is this a bulgarian or russian name. I am a bulgarian. If you want you can reach me at konst@sprint.ca.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now