YOU can Convert your macros to VB, and then
Add an OK button and a Cancel button. Not sure I remember if there is a cancel button. The Cancel button code
should be a close form event
Sub.......
Add behind the cmdlogin button:
If me![TextPassword]<>"Your password goes here" Then
msgbox" You did not provide a valid password",VBOK
Else
'Close the password form code goes here
'Open the desired form or do the next action desired
End if
End Sub
Now if you are trying to provide security for all users with passwords, you'll need a table users with username and password in it. and must check user name and password at login before you proceed.(See Below)
________________________________________________________________________________
_________________________________________________________________________________
______
private sub cmdLogin_Click()
Dim sPswd as string
If IsNull(Me.txtUser) = True or IsNull(Me.txtPswd) = True then
msgbox "Please enter both a userid and password"
exit sub
end if
'DLOOKUP returns null if no record found therefore give it a default value of ""
sPswd = NZ(DLOOKUP("Pswd","tblUsers","UserID='" & Me.txtUser & "'"),"")
If Me.txtPswd <> sPswd then
msgbox "Invalid UserID/Password combination"
exit sub
end if
'Continue with normal successful login code
end sub
________________________________________________________________________________
_________________________________________________
Hope I helped.