By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

Password Verification Form...

P: n/a
All,
This should be very simple for you VB programmers, I am just a
beginner and am stuck! It should be very simple... what am I not
doing right?

Dim PW As String

PW = Me.Password

If PasswordVerify <> Password Or IsNull(PasswordVerify = True)
Then
MsgBox "Password you've entered do not match. Please Retype."
Me.PasswordVerify = ""
[Password].SetFocus
Me.Password = PW
Else: MsgBox "Your new password has successfully been set."
End If
I have 2 boxes, "Password" and "PasswordVerify". Password box is
based on a Table while PasswordVerify is just an unbound box. If user
enters an password that do not match, it will revert back to its
original password. I named it PW. But apparently, me.password = pw
did not do so. What did I code wrong?

Thanks.
PC
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
pe******@yahoo.com (PerryC) wrote in
news:ea*************************@posting.google.co m:
All,
This should be very simple for you VB programmers, I am
just a
beginner and am stuck! It should be very simple... what am I
not doing right?

Dim PW As String

PW = Me.Password
The next line of code is bad. If PasswordVerify <> Password Or IsNull(PasswordVerify =
True)
Then

it should be:
If PasswordVerify <> Password Or IsNull(PasswordVerify)

because
(PasswordVerify = true) can never be null.

You'd simplify everything however but inverting the logic

If me.Password = PasswordVerify then
msgBox "Your new password has successfully been set"
else
msgBox " whatever"
me.PasswordVerify = null
me.Password.setfocus
me.Password = PW
End If

Note password = passwordverify will be false if either side is
null. That makes the whole thing easier to manage.

Bob Quintal

MsgBox "Password you've entered do not match. Please Retype." Me.PasswordVerify = ""
[Password].SetFocus
Me.Password = PW
Else: MsgBox "Your new password has successfully been
set."
End If
I have 2 boxes, "Password" and "PasswordVerify". Password box
is based on a Table while PasswordVerify is just an unbound
box. If user enters an password that do not match, it will
revert back to its original password. I named it PW. But
apparently, me.password = pw did not do so. What did I code
wrong?

Thanks.
PC


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.