Solved

Multiple Users w/autonumber

Posted on 1998-06-17
6
177 Views
Last Modified: 2008-03-06
I have multiple users on a network.  I have a customerform, with a main form button to list all workorders in a datasheet view.  The problem that has been persistant for the past couple of weeks is the autonumber.  Example, If I enter something in a textbox, it automatically generates number 12, for workorder # 12.  If I don't refresh or requery my form before I enter in another workorder, then the autonumber missmatches with the record selector on the bottom left hand of the page.  Example, Workorder # 12, will be #13 on the record selector.  Is there anything I can do so I don't have to keep refreshing or requerying to enter the next record?
0
Comment
Question by:scorp8
  • 3
  • 3
6 Comments
 
LVL 6

Accepted Solution

by:
devtha earned 30 total points
ID: 1975455
If the mainform is based on a query the use requery.
Or..
    On form activate event use forms.refresh or
fieldname.requery
Assuming that the field that gets 12 has some type of query or expression which brings that value 12.
Devtha
0
 
LVL 1

Author Comment

by:scorp8
ID: 1975456
Devtha

I don't understand what you mean on the above comment?

Currently on my customerform I have a refresh and requery button for each individual user to push before entering in a workorder.  If they don't push each button before they enter a new account, the autonumber will skip.  Causing an unever autonumber and record selector.  This is critical because when they view the main page, there is a dblclick feature on the autonumber to pull up that specific workorder to the main form.  Sorry if this is confusing..
0
 
LVL 6

Expert Comment

by:devtha
ID: 1975457
It is not a good idea to make a user go for an extra step like clicking a button in your case. You need to make that automatic. Try to use the underlying code of the button on the open or activate event of the form. Or you can also put it on the getfocus of the first dataentry field of the form. This way every time a user enters a new record starting from the first field he/she will get the autonumber , and they do not have to click that button.
Devtha
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 1

Author Comment

by:scorp8
ID: 1975458
Devtha
I understand what you saying, and I agree.  They shouldn't have to take an extra step in clicking another button, but if they don't requery than "user A" will be entering in an account at the same time "user B" is entering in an account and it issues two separate autonumbers and recordselectors, but for some reason it tends to throw the numbers off from time to time.  I'm curious if this is a refresh interval problem!?!?!
0
 
LVL 6

Expert Comment

by:devtha
ID: 1975459
I am not saying you should not requery.
What is your code on the requery button?
Take that code (copy it) and paste it on some event that should fire everytime a user tries to enter a new record.
Lets say a PArtID is the first field you are going to enter on a form then, you need to go to that field in design mode, go to the exit event type something like this:
if not isnull([partid]) then
'requery code from the button you have
end if
Devtha
0
 
LVL 1

Author Comment

by:scorp8
ID: 1975460
I appreciate your help, Thanks!!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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.
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…

708 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

10 Experts available now in Live!

Get 1:1 Help Now