Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Solved: Create a "Change Password" form for Login in Access 2007


(!)

OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 04:38 AM #31
Change the user name Combo to a "Find" combo, this will find the record for that person in the form.
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
02-May-2012, 06:45 AM #32
Okay. I created a Find Combo, but how do I get it to automatically pull the record for the person who is signed in?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 07:22 AM #33
A find combo should do that automatically.
Are you sure it is a "find" combo.
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
02-May-2012, 07:24 AM #34
I chose the "Find a record on my form based on the value I selected in my combo box." option. Is that what I wanted to do?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 07:28 AM #35
Yes, when you select the user for the password entry the form should move to the correct record, have you made the fields visible to see what is happening?
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
02-May-2012, 07:31 AM #36
Yes, I have all fields visible. I think I misrepresented my problem. I can choose anyone I want from the drop down menu, and the database knows to bring up that person's information. However, I wanted the form to recognize who was logged in, and automatically bring up that person's name and ID number. Then, I could disable the field, so that people can only have access to their own information.

Does that make sense? Can I do that?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 07:35 AM #37
Sorry, I thought you were talking about the original Log in form, but now I assume that you are talking about the Change password form?
You can use VBA to filter the form when it is opened using the public variable.
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
02-May-2012, 07:50 AM #38
Okay...sorry for the miscommunication.

Yay! VBA!!! Is it possible/probable for me to do it or find it?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 08:31 AM #39
Look at the form opening button's VBA it uses the variable
Dim stLinkCriteria As String
add a line of code
stLinkCriteria = lngMyEmpID
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
02-May-2012, 09:03 AM #40
That didn't work. Could I be missing something?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
02-May-2012, 10:36 AM #41
No you are not missing anything, it is an Access 2007 bug.
The alternative is to add this to the Password Form's On Load Event Procedure.

Me.Filter = "[lngEmpID] = " & lngMyEmpID
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
03-May-2012, 07:08 AM #42
That still doesn't make the employee's name appear automatically. Do I need to link the forms together or something like that? I think I read an article on that a couple of weeks ago.
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,651 posts.
 
Join Date: Mar 2005
Location: UK
03-May-2012, 07:23 AM #43
It works for me. Do you want me to send you your database with the change in it?
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
03-May-2012, 07:28 AM #44
That would be great. Thanks.
krs1716's Avatar
krs1716 krs1716 is offline
Member with 438 posts.
THREAD STARTER
 
Join Date: Feb 2012
Experience: Intermediate
03-May-2012, 09:12 AM #45
Yay! That worked. Just a note...the issue with my Change Password form vs. yours is that you had the field from the table representing the employee (i.e. strEmpName). I had an unbound combo box.

So sorry for the issues. I guess I had to see it to understand it.

Now, one more thing on this subject ...I have some VBA code written that I think will check the value of the Old password to see if it is correct. However, I have no idea how to write the code to check the "New Password" field against the "Confirm New Password" field and then use that confirmation to change the password in the employees table (tblEmployees).

The code I have to check the value in the Old Password field is as follows (after clicking a button called "OK":
Option Compare Database
Private Sub Command1_Click()
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", _
"[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close Change Password Form
'Close Change Password form
DoCmd.Close acForm, "Change Password Form", acSaveYes
End If
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtPassword.SetFocus
End If
End Sub
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑