I thought I had this handled...however it seems that it's not quite 100%.
I have a database that has a single user form. This form, upon loading, has a recordsource which selects only those records which have two fields marked as "No".
The fields are named LOCKED and COMPLETED. They are just Yes/No fields.
If either one is marked as Yes, it is excluded in the query.
If they are both marked as No, they are included in a query which is a SQL query that uses TOP 100 to grab the first 100 records. It then runs a randomize on a seed which is different for every user of the database, and using that randomize it creates an alias based on that seed and a partial account number, then arranges the generated random number Descending. It then takes these group of 100 ordered and slects the first one by doing a TOP 1 query. So it's a nested query. It looks like this:
When the form is loaded, I have the following:
The strSeed has a random number assigned to it which is pulled from a table of users. Each user has a unique number which is 9 digits long.
The unique numbers were generated at random.org.
I thought that all of these steps would prevent users from selecting the same record and being able to open it, but there are still a few who are getting the same record to work on. There are about 30-40 users at any one time using it.
Also, after the Randomize, I have this code in the Form_Load():
I'm not sure if it needs the Requery, but I put it in to force it to grab a new record, and then set the LOCKED field to true and refresh.
Can anyone see my issue, or suggest a better way of doing this?
I cannot have the same person working on the same record at once - they shouldn't even be able to pull the same record up at all. They are doing phone calls based on these so we don't want the same person called twice.
Ideas are appreciated. Thanks!
I have a database that has a single user form. This form, upon loading, has a recordsource which selects only those records which have two fields marked as "No".
The fields are named LOCKED and COMPLETED. They are just Yes/No fields.
If either one is marked as Yes, it is excluded in the query.
If they are both marked as No, they are included in a query which is a SQL query that uses TOP 100 to grab the first 100 records. It then runs a randomize on a seed which is different for every user of the database, and using that randomize it creates an alias based on that seed and a partial account number, then arranges the generated random number Descending. It then takes these group of 100 ordered and slects the first one by doing a TOP 1 query. So it's a nested query. It looks like this:
Code:
SELECT TOP 1 *, Rnd(tblMain.ACCTNUM) As Expr1 FROM
(SELECT TOP 100 * FROM tblMain WHERE
tblMain.COMPLETED = False AND tblMain.LOCKED = False)
ORDER BY Rnd(tblMain.ACCTNUM) DESC;
When the form is loaded, I have the following:
Code:
Randomize strSeed
The strSeed has a random number assigned to it which is pulled from a table of users. Each user has a unique number which is 9 digits long.
The unique numbers were generated at random.org.
I thought that all of these steps would prevent users from selecting the same record and being able to open it, but there are still a few who are getting the same record to work on. There are about 30-40 users at any one time using it.
Also, after the Randomize, I have this code in the Form_Load():
Code:
Me.Form.Requery
Me.LOCKED = True
Me.Refresh
I'm not sure if it needs the Requery, but I put it in to force it to grab a new record, and then set the LOCKED field to true and refresh.
Can anyone see my issue, or suggest a better way of doing this?
I cannot have the same person working on the same record at once - they shouldn't even be able to pull the same record up at all. They are doing phone calls based on these so we don't want the same person called twice.
Ideas are appreciated. Thanks!