AfterUpdate

Dave Edwards

New member
Local time
Today, 14:25
Joined
Apr 3, 2000
Messages
8
Hi
I'm having a problem ensuring that the user enters valid data.
On a form after the user has input their values for several fields I am using AfterUpdate to check if they have a valid input according to the rules of the program.
For example if the totals of fields 1 and 2 are less than the total of fields 3 and 4 then an error box comes up and the focus returns to field1 of that row so that they can amend their entry. I have used the follow in AfterUpdate for the form.
Private Sub Form_AfterUpdate()
If (field1 + field2) > (field3 + field4) Then
MsgBox "Invalid Entry.", vbExclamation, "Error:"
field1.SetFocus
End IF
End Sub
This works fine, but if the user now tabs through the record onto the next row then AfterUpdate will not run as the user has made no changes to the row.
Any suggestions please.

[This message has been edited by Dave Edwards (edited 05-13-2000).]
 
Thanks, this is exactly what I was after
smile.gif
 

Users who are viewing this thread

Back
Top Bottom