Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Unanswered: Determining if a record returned in a recordset is locked ...

    Hi all ...

    Got a problem here ... I have a table that I read the entire record. I need a way to figure out if the record returned has been locked by another user ... Any ideas?

    Some code:

    Code:
                    SQLString = "SELECT * FROM [WO Billing] WHERE (WorkOrderNumber='" & MyRecSet.Fields(1).Value & "');"
                    TrgRecSet.Open SQLString, MyConnect
                    If TrgRecSet.BOF = False Then
                        TrgRecSet.MoveFirst
                        ' Regular Hours
                        TrgRecSet.Fields(1).Value = TrgRecSet.Fields(1).Value + MyRecSet.Fields(6).Value
                        ' OT Hours
                        TrgRecSet.Fields(2).Value = TrgRecSet.Fields(2).Value + MyRecSet.Fields(7).Value
                        ' DT Hours
                        TrgRecSet.Fields(3).Value = TrgRecSet.Fields(3).Value + MyRecSet.Fields(8).Value
                        ' Regular Hours Cost
                        TrgRecSet.Fields(4).Value = TrgRecSet.Fields(4).Value + MyRecSet.Fields(6).Value * CDbl(HourlyRateTxt)
                        ' OT Hours Cost
                        TrgRecSet.Fields(5).Value = TrgRecSet.Fields(5).Value + MyRecSet.Fields(7).Value * CDbl(HourlyRateTxt)
                        ' DT Hours Cost
                        TrgRecSet.Fields(6).Value = TrgRecSet.Fields(6).Value + MyRecSet.Fields(8).Value * CDbl(HourlyRateTxt)
                        TrgRecSet.Update
                    End If
                    TrgRecSet.Close
    Particulars: Access 2000. The recordset is dynamic and lockoptimistic ...

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    See the Sentence LockEdit and On Error.
    This two sentence returned the Locked condicion.
    Saludos
    Norberto

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •