Equal Other Field

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

Guest

Sorry for my beginner status to databases... but I'm using Access to learn
them.

I'm just running a simple database that I would eventually like to put into
a web site I am doing. It's something everyone has... user info.

I'm trying to have them enter in their email address twice so that I can
make sure they entered it in correctly. So I need to make sure that the
second on equals the first one. Can someone help me with the validation rule
on this?

I named the two fields "email" and "remail". I want "remail" to equal what
was typed in "email" through validation rules.
 
well, i can give you a solution that will work in a form in Access. how it
will translate to your web solution, i don't know.

first, suggest you only have one field in your table for email address. you
can use two controls in a data entry form to verify the address, but you
should not *store* it twice.

in the form, bind the email field to the email control. leave the remail
control as unbound. to allow your users maximum freedom in filling out the
form, and minimize the code needed, suggest you validate the email address
in the form's BeforeUpdate event, as

If IsNull(Me!email) Or IsNull(Me!remail) Then
Cancel = True
Msgbox "Enter the email address in both fields, please."
Me!email.SetFocus
Else
If Not Me!email = Me!remail Then
Cancel = True
Msgbox "Please re-enter your email address " _
& "in both fields."
Me!email = Null
Me!remail = Null
Me!email.SetFocus
End If
End If

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top