PC Review


Reply
Thread Tools Rate Thread

Change Password from an Array

 
 
spences10
Guest
Posts: n/a
 
      14th Jan 2007
Hi,

I have devised a UserForm that asks for a username and password which
in turn unlocks certain parts of a work book for that user, I want to
enable them to change the password that has been assigned to them.

I am currently trying to use InputBox method for this, with some degree
of success where I can populate the sheet with the passwords on it, but
not for each individual user. So what I think I need is a way to look
up who the user is in the array then change the password for that user.

 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      14th Jan 2007
You said inputbox, but unless you want to show a series of inputboxes, I
would use a userform such as below
Assume the username is in Textbox1 and the usernames are listed in Sheet10
starting in A1 and current corresponding passwords in column B

Textbox2: Old Password
Textbox3: New Password
Textobx4: New Password (confirmation)

Private Sub CommandButton1_Click()
Dim rng as Range
Dim res as Variant
With worksheets("Sheet1")
set rng = .Range(.Cells(1,1),Cells(1,1).End(xldown))
end with
res = Application.Match(Textbox1.Value,rng,0)
if not iserror(res) then
if rng(res).offset(0,1).Value = Textbox2.Text then
if Textbox3.Value = Textbox4.Value then
rng(res).offset(0,1).Value = Textbox3.Value
Activeworkbook.Save
msgbox "Password Changed
else
msgbox "Passwords do not match"
exit sub
end if
else
msgbox "Orignal password incorrect"
exit sub
end if
Else
msgbox "Invalid user id"
exit sub
end if
End Sub

If you still want to use inputboxes, then the above should give you the
basics with which you can integrate inputbox promts..

--
Regards,
Tom Ogilvy
"spences10" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have devised a UserForm that asks for a username and password which
> in turn unlocks certain parts of a work book for that user, I want to
> enable them to change the password that has been assigned to them.
>
> I am currently trying to use InputBox method for this, with some degree
> of success where I can populate the sheet with the passwords on it, but
> not for each individual user. So what I think I need is a way to look
> up who the user is in the array then change the password for that user.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change a users password without knowing the old password nor the answer to the password question AAaron123 Microsoft ASP .NET 1 16th Jan 2009 02:56 PM
How can Administrator change the Password of existing User, without knowing his Old Password in Administer Security Tool ? Luqman Microsoft ASP .NET 5 12th Jul 2007 10:29 AM
Password Problem --> Password change message after pw change Giovanni Microsoft Windows 2000 Active Directory 2 30th Sep 2004 01:29 PM
Changing Password to an account that has to change password at first logon using System.DirectoryServices Fabrizio Microsoft C# .NET 10 1st Jul 2004 03:15 PM
Password change not resetting password change timer David Martino Microsoft Windows 2000 Active Directory 0 18th Jul 2003 04:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:41 AM.