Link to home
Start Free TrialLog in
Avatar of mjbdbase
mjbdbase

asked on

Validate field values before leaving record

Hello

I have 2 fields and would like to not let the user leave the record, nor save it if the field values aren't equal.

I would like to have a message box tell them they can't leave until they both enter or otherwise the record will not be saved.

I am using Access 2003 with Windows xp

Many thanks in advance
Private Sub DelaysMinutesfromDelays_AfterUpdate()
    If [DelaysMinutesfromDelays] < [Minutes of Delays] Then
            MsgBox "Warning: Both fields need to equal " & _
            "please re-enter you delays."
    End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of pseyler
pseyler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mjbdbase
mjbdbase

ASKER

Thanks for that - worked like a charm