PLEASE HELP - FIELD VALIDATION QUESTION

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I AM TRYING TO FIGURE OUT HOW TO VALIDATE THAT 2 FIELDS ARE THE SAME

FOR EXAMPLE I'M USING THE FOLLOWING CODE TO DETERMINE IF THE FIRST FIELD IS FILLED IN

If IsNull(Me.Email) = True The
MsgBox "Please enter your Email Address!
Me.Email.SetFocu
Exit Su
End I

NOW I'M TRYING TO CONFIRM THIS INFO AGAINST ANOTHER FIELD

IE
FIELD 1 = EMAI
FIELD 2 = CONFIRM EMAI

PLEASE ANY HELP WOULD BE GREAT. PLEASE TRY TO BE AS DETAILED AS POSSIBLE

THANK YOU IN ADVANC

MIK
 
Hello Mike

The simplest method is to add the following code to the
Forms "On Current" Procedure: -
If Field1 <> "" Then Field2=Field1
The following code will make it more dynamic....

Declare a "ChangeDetected" Boolean (needs to be a "public
variable"

Add This To Field1 "On Change" Procedure: -
ChangeDetected=True

Add This to Field1 "On Exit" Procedure: -
If ChangeDetected = False then exit Sub
ChangeDetected=False
me.Field2=me.Field1.

HTH

Tony C.
 
Back
Top