T
Tony Williams
I have a form that contains a number of numeric controls. The user fills in
all the controls, even the totals. I have validation code on each total to
make sure the total is correct (the user wants to key in the total and
Access check if it's correct). An example of the code in the before update
of the totals follows:
Private Sub txtDomfactot_BeforeUpdate(Cancel As Integer)
If ([txtDomfacsole] + [txtDomfacpart]) <> [txtDomfactot] Then
If MsgBox("Row 1 does not add up" & vbCrLf & "It should be " &
[txtDomfacsole] + [txtDomfacpart] & " - Do you want to accept the error?",
vbYesNo, "Calculation Error") = vbNo Then
Cancel = True
End If
End If
End Sub
That works fine on initial input but if they edit any of the figures and
don't amend the total there is no error message. Is there anyway of putting
this code somewhere so that if they amend any figure the total is rechecked
and the error message appears?
TIA
Tony
all the controls, even the totals. I have validation code on each total to
make sure the total is correct (the user wants to key in the total and
Access check if it's correct). An example of the code in the before update
of the totals follows:
Private Sub txtDomfactot_BeforeUpdate(Cancel As Integer)
If ([txtDomfacsole] + [txtDomfacpart]) <> [txtDomfactot] Then
If MsgBox("Row 1 does not add up" & vbCrLf & "It should be " &
[txtDomfacsole] + [txtDomfacpart] & " - Do you want to accept the error?",
vbYesNo, "Calculation Error") = vbNo Then
Cancel = True
End If
End If
End Sub
That works fine on initial input but if they edit any of the figures and
don't amend the total there is no error message. Is there anyway of putting
this code somewhere so that if they amend any figure the total is rechecked
and the error message appears?
TIA
Tony