Rotating through a list... (1 Viewer)

brian0721

Registered User.
Local time
Today, 17:20
Joined
Dec 5, 2001
Messages
103
Not sure if this is the right part of the forum to put this in. Basically, I have a list of 5 names that each get a lead in turn as it comes in... I want to be able to make something show up on my form that will show the next person in line essentially, or whose turn it is... and im stuck...lol
 

namliam

The Mailman - AWF VIP
Local time
Today, 18:20
Joined
Aug 11, 2003
Messages
11,695
I presume you have a table where you have your persons in? This table will have a PK... All PKs are Autonumber fields or simularly "incremental" keys

There are a couple of ways you can handle this, just of hand....:
1) best/least overhead
Get the latest lead first and find out who got that lead (the PK).
Fetch from your "person" table the next PK to be used.

2) More overhead, easier to implement.
Have a small table with only one record to save the PK of the last person to get the lead. Fetch that and get the next one in line.

3) Add a column
Add a column to your table, either a yes/no field or a number field
a) Yes/No
Alternate the Yes/no field, Any "person" with a tickmark (yes) has had a lead in this rotation. Pick the first one that has "no" in this field to give the next lead to, once the lead is given, change the field to Yes.
Once everyone has had a lead, update all persons to No and start over.

b) Number field
To store the last PK of your lead table, assuming this is an autonumber it is simply a matter of sorting on this field to get the person with the oldest lead, this is in line to get a new one.
Once he gets a new one, simply overwrite the leadnumber to this person and your can rince and repeat.
 

Users who are viewing this thread

Top Bottom