Need help on passwords

  • Thread starter Thread starter richie_b60
  • Start date Start date
R

richie_b60

Guest
hiya everyone:o . is there anyone that can help me.i need to know how i can put passwords onto access programs i have made. so when i open a form you have to enter a password to get in to it.
thanks richie_b60:confused:
 
Search around the forum for there are plenty of examples floating around.
 
I think one of the simplist methods is: click tools,security, set database password and thn from there it tells you what to do
 
VooDoo said:
I think one of the simplist methods is: click tools,security, set database password and thn from there it tells you what to do
He wants a form password, not an open database password. There are plenty of examples floating around the forum.
 
ghudson said:
He wants a form password, not an open database password. There are plenty of examples floating around the forum.

well send me that way .
 
A little help

Hi,

Here is a basic example of a password script.

You want to make a new form and call it something like frmPassword.
On the form you want to make a text box and call that "Password". Also you want to make the input mask for the box a password (Text Box Properties).
Make a button and then call it "OK", go to its properties and in the on click event open the code interface. Enter this code.


Code:
Private Sub OK_Click()
    If Password = "[B][COLOR="Red"]password[/COLOR][/B]" Then
    Dim stDocName As String
    Dim stLinkCriteria As String
    
    stDocName = "[B][COLOR="blue"]frmCorrect[/COLOR][/B]"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBer, acEditMenu, 6, , acMenuVer70
    DoCmd.Close acForm, "[B][COLOR="Blue"]frmPassword[/COLOR][/B]", acSavePrompt
    
    
    Else
  
    MsgBox ("[B]Your Password Was Incorrect. Please Check and try again.[/B]")
    End If
End Sub

You will want to change some of the bold values.... The red is the password, blue is the forms and black is the message for an incorrect password.

Have fun!
 
lessthanme5 said:
Hi,

Here is a basic example of a password script.

You want to make a new form and call it something like frmPassword.
On the form you want to make a text box and call that "Password". Also you want to make the input mask for the box a password (Text Box Properties).
Make a button and then call it "OK", go to its properties and in the on click event open the code interface. Enter this code.


Code:
Private Sub OK_Click()
    If Password = "[B][COLOR="Red"]password[/COLOR][/B]" Then
    Dim stDocName As String
    Dim stLinkCriteria As String
    
    stDocName = "[B][COLOR="blue"]frmCorrect[/COLOR][/B]"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBer, acEditMenu, 6, , acMenuVer70
    DoCmd.Close acForm, "[B][COLOR="Blue"]frmPassword[/COLOR][/B]", acSavePrompt
    
    
    Else
  
    MsgBox ("[B]Your Password Was Incorrect. Please Check and try again.[/B]")
    End If
End Sub

You will want to change some of the bold values.... The red is the password, blue is the forms and black is the message for an incorrect password.

Have fun!

I like this code, but have 1 question what does these two lines do ?

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBer, acEditMenu, 6, , acMenuVer70

Reason I ask is I if remove those 2 lines,
my form opens and has focus (curson goes to the first form box)

with the 2 lines the forms opens but I need to click on the form to get focus on the 1st form box...
 

Users who are viewing this thread

Back
Top Bottom