I would like to create a Command button (basically a Yes/no Button) on a form that is password protected , essientially when you click on it I want it to ask you for a Password before it will operate . . any Ideas anybody ??
One quick solution is to use the onclick event... Use an Inputbox to ask the user for a password. If the password does not match a hard-coded value (or database value or encrypted value) then exit the onclick event. htwh Steve Medvid
"IT Consultant & Web Master"
Hi Steve,
Thanks for the response , Actually I am a complete newbie at Access and was looking for help with the actual code for the event to do this operation . . . anywhere you can point me would be helpfull
Here is a quick sample from a command button that launches a data entry form... Remember the only way to learn is to experiment...
htwh...
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form1"
Dim strInput As String
Dim strMsg As String
strMsg = "Enter your password:"
strInput = InputBox(Prompt:=strMsg, Title:="Password Entry", XPos:=2000, YPos:=2000)
MsgBox (strInput) 'Just to see if it is working...
If strInput = "super" Then
MsgBox ("You Entered the correct password" 'Remove later
'DoCmd.OpenForm stDocName, , , stLinkCriteria 'Uncomment later
Else
MsgBox ("You Entered the WRONG password!"
Exit Sub
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.