G
Guest
I have a database and I would like to password protect a form.
I have created a table called tblpassword with two fields
user (primary key)
password
Then I created a from that will open when you click on the switchboard
button for this form it pops up requesting the user name and password.
Both unbounded text boxes named User and Password respectivly.
I then have a command button that is to run a macro if the user name and
password are corret...here is the code I put in at the on click for the
command button. (Run-time error '3078') so I do the debug and it highlights
the line in code reading...
If Me.Password = DLookup("[Password]", "tlbpassword", "[User]='" & Me.User &
"'") Then
Any idea...I know this is not the best for security however this is how the
higher powers want it.
Private Sub Command8_Click()
If Me.Password = DLookup("[Password]", "tlbpassword", "[User]='" & Me.User
& "'") Then
DoCmd.RunMacro (OpenForm)
Else
MsgBox "Invalid password"
End If
End Sub
I then put a few test User and Passwords in the table however I get an error
when I click the button...
I have created a table called tblpassword with two fields
user (primary key)
password
Then I created a from that will open when you click on the switchboard
button for this form it pops up requesting the user name and password.
Both unbounded text boxes named User and Password respectivly.
I then have a command button that is to run a macro if the user name and
password are corret...here is the code I put in at the on click for the
command button. (Run-time error '3078') so I do the debug and it highlights
the line in code reading...
If Me.Password = DLookup("[Password]", "tlbpassword", "[User]='" & Me.User &
"'") Then
Any idea...I know this is not the best for security however this is how the
higher powers want it.
Private Sub Command8_Click()
If Me.Password = DLookup("[Password]", "tlbpassword", "[User]='" & Me.User
& "'") Then
DoCmd.RunMacro (OpenForm)
Else
MsgBox "Invalid password"
End If
End Sub
I then put a few test User and Passwords in the table however I get an error
when I click the button...