You could use a series of queries to retrieve and then update the values. The other option would be to use DAO. Here is an example using DAO.
Code:
'Somewhere in the table is a record we need to edit
Dim lngRecordID As Long
lngRecordID = 2
Dim a As Long
Dim b As Long
'validate data
If Me.txtValueA.Value > 0 Then
a = Me.txtValueA
Else
Exit Sub
End If
If Me.txtValueB.Value > 0 Then
b = Me.txtValueB
Else
Exit Sub
End If
'open a dynaset
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblValues", dbOpenDynaset)
'Navigate to the correct record and retrieve the value to be edited
rs.FindFirst "KeyValue =" & lngRecordID
Dim lngCurrentValue As Long
If rs![NumberA] > 0 Then
lngCurrentValue = rs![NumberA]
Else
lngCurrentValue = 0
End If
'If we have a number we can do math on, let's update the record
If lngCurrentValue > 0 Then
rs.Edit
rs![NumberA] = lngCurrentValue - a
rs.Update
MsgBox "Update successful"
End If
rs.Close
Set rs = Nothing
Set db = Nothing