Password Query

midge

Registered User.
Local time
Today, 11:07
Joined
Dec 15, 2002
Messages
21
Hi,

I am new to using Microsoft Access 2000 and VBA and I want to create a global function (procedure) so that the user has to type in a password to access the database.

Any help with my problem would be much appreciated.
 
Will using the "Set Database Password" function in the Tools>Security menu not be sufficient?
 
Hi,

Rob, Thanks for your reply but I was wondering if there was VBA code that I could use to do the same procedure.
 
Well there's not a simple command but you can set something up.

Start by creating a form with a textbox for the password and a button to close the form. Set the input mask of the textbox to 'Password'.

Then in the On Click event of the button create this procedure:

Private Sub Button_Click()

Dim strPassword as string

strpassword=me!txtboxName

if strpassword="TypeYourPasswordHere" then
Docmd.Close acForm, "frmName"
Else
MsgBox "You have entered an Incorrect Password.",vbOkOnly+vbCritical
End if

End Sub
 

Users who are viewing this thread

Back
Top Bottom