GaryB
08-04-2006, 11:07 AM
Hi,
I am currently opening a form using a macro and I have that set for Datasheet view and it works fine. I changed from using the macro to opening the form via password and for the love of me, I can't figure out how to get it to open in datasheet view instead of form view. Here is the code I am using.
Private Sub Command14_Click()
' Code Start
If InputBox("Please enter the Administrative " _
& "password to gain access to this form.", _
"Enter Password") <> "password" Then
' The entered password was incorrect
MsgBox "Sorry, the password you have " _
& "entered is incorrect." & vbNewLine _
& "Please contact a Database Administrator.", _
vbExclamation, "Access Denied"
Else
' The entered password was correct
' Open the protected form
' Then close this form
DoCmd.OpenForm "paper pricing setup form"
End If
ExitPoint:
Exit Sub
Resume ExitPoint
End Sub
' Code End
Any help as always would be greatly appreciated.
Thanks,
Gary
I am currently opening a form using a macro and I have that set for Datasheet view and it works fine. I changed from using the macro to opening the form via password and for the love of me, I can't figure out how to get it to open in datasheet view instead of form view. Here is the code I am using.
Private Sub Command14_Click()
' Code Start
If InputBox("Please enter the Administrative " _
& "password to gain access to this form.", _
"Enter Password") <> "password" Then
' The entered password was incorrect
MsgBox "Sorry, the password you have " _
& "entered is incorrect." & vbNewLine _
& "Please contact a Database Administrator.", _
vbExclamation, "Access Denied"
Else
' The entered password was correct
' Open the protected form
' Then close this form
DoCmd.OpenForm "paper pricing setup form"
End If
ExitPoint:
Exit Sub
Resume ExitPoint
End Sub
' Code End
Any help as always would be greatly appreciated.
Thanks,
Gary