Good morning all,
I have a slight issue when trying to open a report by using a command button.
What I have created is a IT database at work which allows users across the company too open the database log a problem so we can pick it up and deal with it.
We do however want to password protect the outstanding tasks report on the main switchboard. I have created a form with a simple text box and a OK button. Now users who know the password can enter it into the text box press ok and open the report.
The problem I am having is what code do I use to open the report.
I am using the following but doesnt appear too work
If Text0 = "******" Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenReport "Outstanding Tasks"
End If
It comes up with a debug error on the DoCmd.Open Report line as well as trying to save something as a .xps.
Thanks in advance
EDIT: Solved it with the following line - DoCmd.OpenReport "ReportName", acViewPreview, , , , "OpenArgs"