Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error 2103

Status
Not open for further replies.

mommom

Technical User
Joined
Nov 14, 2003
Messages
208
Location
US
I am getting the following error message:

The Report name 'Executive Table' you entered in either the property sheet or macro is misspelled or refers to a report that doesn't exist

The report called Executive Table does exist. I do have it set up as password protective though. Could this be the problem.

I have created a separate form with a list of the reports for the users to be able to click on and pull up the report. When they click on the Executive Table it asks for a password. For some reason putting it on a form and having a button on the original form to click to view the reports it keeps giving me the error message.

Is there anything that I can do to fix this problem.

Thanks for any help!
 
Hi, not knowing how you are using the password, I would suspect your are referencing the report incorrectly.

Here is a relatively simple way to use a passord.

Create a button and use the Form Close choice. This is an easy way to build in error checking. Name the button cmdPassword.

Create a textbox and name it txtPassword. Set it to invisible. Change the label caption to "Enter Password"

Go to form Design View and double-click on the event for cmdPassord button. Delete the DoCmd.CLose statement and insert:

me.txtPassword.visible = true
me.txtpassword.set focus.

In the texbox After Update event add the following:

Select case me.txtpassword
case is = "yourPassword"
docmd.openreport "YourReport", acviewpreview
case else:
me.txtPassword.defaultvalue = empty
me.txtPassword.setfocus

msgbox "Incorrect Password. Please ReEnter Password",vbokonly

end select

In the Report's OnClose event you can reset the selections.

forms!yourForm.txtPassword.defaultvalue = empty
forms!yourForm.txtPassword.visible = false

So, when you press the command button a textbox appears and asks for the password. If it is correct, the report prints. On close is sets the text box back to invisible and clears the password.

If the password is incorrect, a messagebox tells you so, the previous password is cleared, focus is returned to the text box for a retry.

Hope that helps.










 
On the form I created the rest of the forms work. Except the one with the password. When I click on that it gives me the above error and highlights "DoCmd.OpenReport x, acViewPreview" of my code listed below.

Private Sub ReportsBox_DblClick(Cancel As Integer)
Dim x As String
x = Me.ReportsBox.Column(0)
DoCmd.OpenReport x, acViewPreview

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top