For those who may be interested in a case similar to mine: multipassword to access a single form (not the entire Db) showing different query results depending on the password/user, this is how I solved.
Starting point: this very useful tutorial suggested by Orange (thanx!) here above.
I adapted case and code to my need (see thread's opening message) and now I have:
* FORM A (continuous) containing list with
- employee name
- employee surname
- employee Id (hidden)
- button calling FORM B on same employee Id
* FORM B (pop-up) containing
- inputbox for password
- employee Id (hidden)
- button leading to the employee personal form
FORM B has been made following part of the instruction of the video mentioned above, from which I kept only the code related to the password case, changing the error warnings from textbox to msgbox (either for wrong password or null field) and directing the opening of the employee personal form on the basis of his Id. Here the code (in caps general indications):
Code:
Private Sub LoginBtn_Click()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("QUERY_NAME")
rs.FindFirst "PASSWORD_COLUMN_NAME='" & Me.txtPassword & "'"
If rs!PASSWORD_COLUMN_NAME <> Me.txtPassword Then
MsgBox "Wrong password. Retry", vbCritical + vbOKOnly, "Warning!"
Me.txtPassword.SetFocus
Exit Sub
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please insert password", vbCritical + vbOKOnly, "Warning!"
Me.txtPassword.SetFocus
Exit Sub
End If
DoCmd.OpenForm "TARGET_FORM_NAME", acNormal, "", "ID=" & Me!ID
DoCmd.Close acForm, Me.Name
End Sub