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