Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password/Security 1

Status
Not open for further replies.

BT24

Programmer
Joined
Aug 19, 2002
Messages
76
Location
CA
Hello

What i would like to do is to have a simple password system on my database, is it as easy as having a query with all the passwords in it and criteria based on that. i would like it to start on open, but i really dont know where to get started. thanks for all the help

IAMUSELESS
 
Not very secure, but definitely simple! Okay, so make a table called tblUsers with two text fields: Username and Password. Make an unbound form with two text boxes (named txtUsername and txtPassword) and a command button. In the Properties of the command button, set the OnClick event to [Event Procedure] and click the "..." button next to it. Paste the following code:
Code:
If DLookup("[Password]", "tblUsers", _
   "[Username]='" & Me![txtUsername] & "'") = Me![txtPassword] Then
     DoCmd.Close
     DoCmd.OpenForm "frmSwitchboard"
Else
     MsgBox "Wrong!!!"
     Application.Quit
End If
Save the form. Call it something like frmLogin. Then go through the menus to Tools -> Startup and set the "Display Form" box to the name of your form. And you can uncheck "Display Database Window" to make it look really cool.
I haven't tested this, but I think it's okay. If it doesn't work, let me know, and I'll get it right. :-)

--Ryan
 
Thanks Ryan

what is happening is frmLogin is coming up on Open but when i hit the button there is nothing happening. the switchboard is not opening. also where will i add the Usernames and passwords? will i add them to the table? thanks again
IAMUSELESS
 
What you are asking for is a password on your database. Why should you do something that Access will do for you. Click on security, click on database password. You've done it. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I Got it thanks for all the help

IAMUSELESS
 
LOL I guess spending all day figuring out complex problems makes one overlook the obvious solutions sometimes. :-)
 
Can you think of a better way to learn your craft? Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top