?
Solved

Access Auto-number with multiple users

Posted on 1998-04-08
3
Medium Priority
?
194 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 200 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…
Suggested Courses

765 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