Solved

Access Auto-number with multiple users

Posted on 1998-04-08
3
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

733 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