Solved

Access Auto-number with multiple users

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

726 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