G
Guest
I have code that opens a form to input a password. When the password is entered then I click the okay button which causes the form to be invisible. What I want to know is how do I get the information that was typed into the password box assigned to a variable in my code that I can check to verify that the password is correct?
The first part gets the information to check if it is me. If it is me then I have access to the form. If it is not me then they need to enter a password in the form that comes up. This allows me to give a person a password if I need them to do some entries for me and I can change the password at anytime
Please give me examples of what I need to do. I haven't had classes and I have learned by trial and erro
Thanks in advance
Jun
Function CallFormIfAdmin(
' This allows me to access the Data entry form without a passwor
' if it is not me then they need to enter a password
‘ frmDateEntry - form that you need the password to access
‘ frmSubsystems – form used for entering the password. It has the password mask
'-- Define the variables
Dim strUserName As Strin
Dim lngLength As Lon
Dim lngResult As Lon
Dim ap_GetUserName As Strin
Dim strpassword As Strin
'-- Set up the buffe
strUserName = String$(255, 0
lngLength = 25
'-- Make the cal
lngResult = wu_GetUserName(strUserName, lngLength
'-- Assign the valu
ap_GetUserName = strUserNam
‘ Here is where it checks to see if it is me-------------------------------------------------
If ap_GetUserName <> "jecook" The
DoCmd.OpenForm "frmSubsystems", , , , , acDialo
‘ Here is where I need to pass the password to a variable
‘ so that I can check it.
‘ I declared the variable up above as: Dim strpassword As Strin
End I
DoCmd.OpenForm "frmDateEntry
End Functio
The first part gets the information to check if it is me. If it is me then I have access to the form. If it is not me then they need to enter a password in the form that comes up. This allows me to give a person a password if I need them to do some entries for me and I can change the password at anytime
Please give me examples of what I need to do. I haven't had classes and I have learned by trial and erro
Thanks in advance
Jun
Function CallFormIfAdmin(
' This allows me to access the Data entry form without a passwor
' if it is not me then they need to enter a password
‘ frmDateEntry - form that you need the password to access
‘ frmSubsystems – form used for entering the password. It has the password mask
'-- Define the variables
Dim strUserName As Strin
Dim lngLength As Lon
Dim lngResult As Lon
Dim ap_GetUserName As Strin
Dim strpassword As Strin
'-- Set up the buffe
strUserName = String$(255, 0
lngLength = 25
'-- Make the cal
lngResult = wu_GetUserName(strUserName, lngLength
'-- Assign the valu
ap_GetUserName = strUserNam
‘ Here is where it checks to see if it is me-------------------------------------------------
If ap_GetUserName <> "jecook" The
DoCmd.OpenForm "frmSubsystems", , , , , acDialo
‘ Here is where I need to pass the password to a variable
‘ so that I can check it.
‘ I declared the variable up above as: Dim strpassword As Strin
End I
DoCmd.OpenForm "frmDateEntry
End Functio