PDA

View Full Version : Solved: Help with Datasheet View



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

Norie
08-04-2006, 11:12 AM
Gary

Why not just add acFormDS to the OpenForm?
DoCmd.OpenForm "paper pricing setup form", acFormDS

GaryB
08-04-2006, 11:37 AM
Hi Norie,

When you know what you're doing, it's easy. Thanks, that worked perfectly. I will mark this solved.

Thanks

Gary