Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I generate a unique id in a multi user table?

Status
Not open for further replies.

Xenos132

Technical User
Dec 12, 2004
43
CA

Each user has their own PDA and I create a unique ID based on their user ID + and auto number field. Each week they sync this data into a access group table.

In this group table my primary key is this combination ID from each user. The problem I am having is.

I wish too add a record to this table using an access 2003 form and not on a PDA, I’m not quite sure how to make a unique ID.

Is it possible to generate a Unique ID in a separate table using an auto number field, then use this ID+ a default number lets say 1+ the user ID. So my unique ID generated would be 1+1+3,113 THEN 213,313,413…

Thank you

Todd



 
Xenos132,

Which piece is which?

Each user has their own PDA and I create a unique ID based on their user ID + and auto number field

or
So my unique ID generated would be 1+1+3,113

Are there two or three pieces to the unique id? Are you wanting to change the this now? How about Userid + a number?

Need more info...

 
User Id+ a number could work but the problem is this number has to be generated somewhere other than my multy user table, This may be too easy for some I just can’t get my mind around it:)

The reason I can’t edit or add a auto number field to my table is that if I make any changes to it other than to add or edit records my syncing with the PDA’s will report an error. See I only have one unique field to deal with and on each PDA I use the user name + and auto number.

So in my table right now I have Todd1,Todd2,Todd3… Tom1,Tom2,Tom3… as my unique field.

So lets say Todd is at the office and he doesn’t have his PDA with him and he needs to add a record, I would like him to jump on one of the workstations and add a new record to the multy user table. It’s just I just can’t figure out how to generate an Id for the record.
 
Xenos132,

So you would be okay with this?

Todd00001
Todd00002
Todd00003
Todd..
Tod..
..
Todd00468 (you get the idea.

Then create a query use the max function (to get the last "Toddxxxxx" used) then use the function below from your form.

Note the link does not display correctly, copy the whole line and paste to your browser. sorry...



This tools rocks!! Download and incorporate into your app.


I hope this gets you in the right direction.
 
This is where my problem lies, I cant use the next sequential number since the PDA will be making it in it’s own table then when I sync the 2 tables I will have a duplicate number. Therefore I need to generate a new number. Like work1,work2,work3… or anything that it’s own unique number that I can insert into the multi-user table’s Id field.


Again Each PDA makes it’s own unique number ( Username + auto number) then these are synced into a mutly user table.

Can I generate an auto number field in a separate table called tblnumbers then when I add a new record to the multi-user table it will grab the next available number from this tblnumbers table? And use this number as this records unique number in the multi user table.

Man I wish I knew how to express myself properly LOL.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top