skwilliams
Registered User.
- Local time
- Today, 03:52
- Joined
- Jan 18, 2002
- Messages
- 516
I'm using the following code within a tabular form. But when I move out of the first ARTot field, I receive an error because there is no previous TotUC value.
How can I correct this problem?
Private Sub ARTot_LostFocus()
Dim rst As DAO.Recordset
Dim dblValue As Double
Set rst = Me.RecordsetClone
With rst
.Bookmark = Me.Bookmark
.MovePrevious
dblValue = rst.Fields("TotUC")
End With
Me.TotUC = dblValue - Me.UC - Me.DM + Me.CashRec + Me.CM + Me.ARTot
rst.Close
End Sub
How can I correct this problem?
Private Sub ARTot_LostFocus()
Dim rst As DAO.Recordset
Dim dblValue As Double
Set rst = Me.RecordsetClone
With rst
.Bookmark = Me.Bookmark
.MovePrevious
dblValue = rst.Fields("TotUC")
End With
Me.TotUC = dblValue - Me.UC - Me.DM + Me.CashRec + Me.CM + Me.ARTot
rst.Close
End Sub