Link to home
Start Free TrialLog in
Avatar of scorp8
scorp8Flag for United States of America

asked on

Multiple Users w/autonumber

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?
ASKER CERTIFIED SOLUTION
Avatar of devtha
devtha
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scorp8

ASKER

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..
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
Avatar of scorp8

ASKER

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!?!?!
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
Avatar of scorp8

ASKER

I appreciate your help, Thanks!!