Most applications need simple management tools to allow adding and deleting users. My suggestion would be to build a table that has the data for the individuals you would like to extend access to this specific form.
Table can include the following
pkeyId = AutoNumber
strUserNam = Text
strUserId = Text
strPw = Text
Once this is completed design an unbound form with a combo box (cboUserId) for the User Id list and a text box (txtPw) for to validate password with User ID. Add a command button (cmdOpenFrm) and in the On Click event enter the following code:
Private Sub cmdOpenFrm_Click()
Dim intLogonAttempts As Integer
If IsNull(cboUserID) = True Then
MsgBox "Please select user name from drop down.", vbOKOnly, "Invalid User!"
Me.cboUserID.SetFocus
End If
If IsNull(cboPw) = True Then
MsgBox "Please enter correct password.",vbOKOnly, "Invalid Password!"
Me.cboPw.SetFocus
End If
If Me.cboPw.Value = DLookup("strPw", "TABLE NAME", "[pkeyID] =" & Me.cboUserID.Value) Then
cboUserID = Me.cboUserID.Value
DoCmd.Close acForm, "PASSWORD FORM", acSaveNo
DoCmd.OpenForm "DESTINATION FORM"
Else
MsgBox "Password Invalid. Please Try Again.", vbOKOnly, "Invalid Entry!"
Me.cboPw.SetFocus
End If
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 2 Then
MsgBox "You do not have access to this database. Please contact database administrator!"
DoCmd.Close
End If
End Sub
You can comment out the intLogonAttempts if you choose to. This option actually limits the number of attempts to 3. If the user does not complete the password validation within the allowed attempts, the application will be closed.
Good luck.