Here is my vba code:
strSQL = "SELECT TOP 1 [Account Number]
FROM LiveData
WHERE WorkingRep Is Null And Priority In (1);"
Set rst1 = New ADODB.Recordset
With rst1
Debug.Print .State
.Open strSQL, CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic
Debug.Print .State
Me.txtAccountNumber = .Fields(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE LiveData SET WorkingRep = '" & VZID & "' WHERE [Account Number] = " & Me.txtAccountNumber & ";"
Me.txtAccountTime.Value = Now()
DoCmd.SetWarnings True
.Close
End With
My database has multiple users accessing the account numbers - most of which are all at the same time. How can i grab the account number and prevent another user from accessing this record?
strSQL = "SELECT TOP 1 [Account Number]
FROM LiveData
WHERE WorkingRep Is Null And Priority In (1);"
Set rst1 = New ADODB.Recordset
With rst1
Debug.Print .State
.Open strSQL, CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic
Debug.Print .State
Me.txtAccountNumber = .Fields(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE LiveData SET WorkingRep = '" & VZID & "' WHERE [Account Number] = " & Me.txtAccountNumber & ";"
Me.txtAccountTime.Value = Now()
DoCmd.SetWarnings True
.Close
End With
My database has multiple users accessing the account numbers - most of which are all at the same time. How can i grab the account number and prevent another user from accessing this record?