how to?? please

tico78

Registered User.
Local time
Today, 01:41
Joined
Mar 10, 2003
Messages
14
How to create a Login Username and Password Form, when I open it and enter the user-pass it goes to a another Form (menu form or switchboard) in the database (access).. please help
 
Hi there,

As far as a login is concerned, this can be controlled by the generic Access user settings.

But here is some code that I have used for creating a password form.

Hope this is some use to you......

Put this in the AfterUpdate event of your form and substitute my names for ones that are applicable to your form.

Dim stDocName As String
Dim stLinkCriteria As String
Dim strMsg As String
Dim Check
Dim Response As Integer
Dim Msg, Style, Title
Msg = "Please re-enter the correct Password and press enter."
Style = vbOKOnly + vbExclamation
Title = " Incorrect Password" ' Define title.

If InputBox.Text = "Edit543" Then Check = False Else Check = True
If Check = True Then
DoCmd.Beep
Response = MsgBox(Msg, Style, Title)
InputBox.SetFocus
Else
stDocName = "Name of your Form"
stLinkCriteria = "[ItemNo]=" & "'" & Me![ItemNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Your form you wish to access"
DoCmd.Close acForm, "Password", acSaveNo
Exit Sub

End If
 
Last edited:

Users who are viewing this thread

Back
Top Bottom