here's my problem:
I have an access db that is used by aprox 20 users, this db is devided in FE and BE each user has his own copy of the FE. The idea of this DB is that each user can work records from a table, so a user will open the db and get a record, finish working with it and get a new record to work with. i nedd that only one user can view a specific record so i came up with this structure:
Table:
Id - text
type - text
userlock - this will be filled with the username of the person woking the record
userdone - this will be filled with the username of the person that finished the record
locked - yes/no - will be yes if someone is working on the record.
ive posted the code to select new records below.
the problem is that sometimes 2 users get the same record. any ideas wy?
tks
I have an access db that is used by aprox 20 users, this db is devided in FE and BE each user has his own copy of the FE. The idea of this DB is that each user can work records from a table, so a user will open the db and get a record, finish working with it and get a new record to work with. i nedd that only one user can view a specific record so i came up with this structure:
Table:
Id - text
type - text
userlock - this will be filled with the username of the person woking the record
userdone - this will be filled with the username of the person that finished the record
locked - yes/no - will be yes if someone is working on the record.
ive posted the code to select new records below.
the problem is that sometimes 2 users get the same record. any ideas wy?
tks
Code:
Private Sub Command143_Click()
Dim db As Database
Set db = CurrentDb
Dim rs As Recordset
Set rs = db.OpenRecordset("Select * From report where locked=FALSE AND isnull(userdone) and isnull(userlock) and type ='type1'", dbOpenDynaset)
If rs.EOF Then
MsgBox ("No more cases")
Exit Sub
Else
rs.Edit
rs.Fields("locked").Value = True
rs.Fields("userlock").Value = userid
rs.Update
Set rs = Nothing
End If
End Sub
Last edited: