Filling sequential values

Gift Tun

New member
Local time
Today, 11:53
Joined
May 20, 2011
Messages
6
Hello all,

I am a new Access user and I have trying to update my existing table inMS Access.

Here is my problem. I have a set of 333 clients (row) in a table. I inserted last column as "AssignTo" which I would like to assign each unduplicated client to one of the three team members randomly (e.g. Tom, Dan, Sara, Tom, Dan, Sara, and so on) At the end, Tom will have 111 clients belong to him as well as Dan and Sara.

Here is what the table should look like;

ID LastName FirstName Address AssignTo
1 Mouse Mickey Disney Land Tom
2 Mouse Minnie Disney Land Dan
3 Kent Clark Smallville Sara
4 Luthor Lex Bigville Tom

And so on

Could someone please help me?

Thank you so much.

PS. I am very new to Access nad haven't used Macro at all.
 
Run 3 update queries--Assign all those with an ID under 112 to Dan, those 112 - 222 to Tom and all those above 222 to Sara.

UPDATE TableName SET AssignTo='Dan' WHERE ID<112;
UPDATE TableName SET AssignTo='Tom' WHERE ID>=112 AND ID<=222;
UPDATE TableName SET AssignTo='Sara' WHERE ID>222;
 
Thank you for your response. Do you know a way to update it like Tom, Dan, Sara, Tom, Dan, Sara, Tom,....

So Tom will get the first, fourth, seventh, tenth,... clients
Dan will get the second, fifth, eighth, eleventh,...clients
Sara will get the third, sixth, nineth, twelveth,...cliets

I would like them to randomly get client names.

Please advise!!

Thank you so much!
 
First: That's just as random as my initial method.

Second: Why?

Third:

UPDATE TableName SET AssignTo='Tom' WHERE (([ID] Mod 3)=1);
UPDATE TableName SET AssignTo='Dan' WHERE (([ID] Mod 3)=2);
UPDATE TableName SET AssignTo='Sara' WHERE (([ID] Mod 3)=0);
 
Thank you so much!!! I will try :)

The reason is: There is another column that I haven't listed it here is shown how long the clients have been with us. So, I hope, by doing this way, our staff will get customers randomly, regardless the period of time.

Thank you once again!! I will try :)
 
It works great!! Thank you so much. I greatly appreciate your help :)
 

Users who are viewing this thread

Back
Top Bottom