A
Alex
Hi experts,
I'm using a continuous form for data entries into
textboxes applying recordset.
When user entered data and in some textbox it's incorrect
all entered data (because of Exit Sub and no reaching
Update ) is disappearing. The user should enter everything
again. How could I avoid it and correct only incorrect
data.
Thanks
While .EOF
If ![UsedUnits] > 0 Or ![UsedKG] > 0 Then
.Edit
...
snlRecUnits = ![RecUnits] - ![UsedUnits]
If snlRecUnits >= 0 Then
![RecUnits] = snlRecUnits
Else
DoCmd.GoToRecord acDataForm, strFormName, acGoTo, n
Msg = MsgBox("The rest of units cannot be less than 0 in
the row #" & n & ".", vbCritical, _
"Units less than 0")
rst.Close
dbs.Close
Exit Sub
End If
...
..Update
End If
...
I'm using a continuous form for data entries into
textboxes applying recordset.
When user entered data and in some textbox it's incorrect
all entered data (because of Exit Sub and no reaching
Update ) is disappearing. The user should enter everything
again. How could I avoid it and correct only incorrect
data.
Thanks
While .EOF
If ![UsedUnits] > 0 Or ![UsedKG] > 0 Then
.Edit
...
snlRecUnits = ![RecUnits] - ![UsedUnits]
If snlRecUnits >= 0 Then
![RecUnits] = snlRecUnits
Else
DoCmd.GoToRecord acDataForm, strFormName, acGoTo, n
Msg = MsgBox("The rest of units cannot be less than 0 in
the row #" & n & ".", vbCritical, _
"Units less than 0")
rst.Close
dbs.Close
Exit Sub
End If
...
..Update
End If
...