Loop through continuous form recordset crash

It's Saturday night here in HK... Nobody is on our SP. I have no crash. It all works fine. Except that the initial problem I had of record being locked has not been resolved. Whether I use an UPDATE query or the recordsetclone, the result is the same.
What I need is to find a way to unlock that current record.

I guess the crash you get is because when moving tables to SP, there is a bit of cleaning to do... The export is never 100% smooth.
 
Ok since the current record is locked, I can still update it separately through the form... So here is the new code. It works well:
Code:
Private Sub cboPoCurrency_AfterUpdate()
On Error GoTo ErrHandler
    Dim db As Database
    Dim strSql As String
    Dim dblRate As Double
    Set db = CurrentDb
    dblNCostR = DLookup("ExRate", "Currency", "ID = " & [cboPoCurrency])
    dblRate = dblNCostR / dblOCostR
    With Me.sbfProductDetails.Form
        .txtUnitCost.Value = .txtUnitCost.Value * dblRate
    End With
        strSql = "UPDATE QuoteLineItems SET QuoteLineItems.UnitCost = [UnitCost] * " & dblRate & _
                " WHERE QuoteLineItems.QuoteID = " & Me.txtID & ";"
    db.Execute strSql
    Me.txtPOExchRate.Value = dblNCostR
    Set db = Nothing
ExitSub:
    Exit Sub
ErrHandler:
    Call ErrorAlert
    Resume ExitSub
End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom