Solved

Access Auto-number with multiple users

Posted on 1998-04-08
3
168 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

760 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

21 Experts available now in Live!

Get 1:1 Help Now