Where is my report in Microsoft Access Class Objects

T

Tony Williams

I have a command button on a form that should open a report. I wanted to
create an Event Procedure on the OnClick event to open the report but it
doesn't appear in the Microsoft Access Class Objects window in theVBA
editor. In fact only one of my reports does. Why is this?
The code I am using is
Private Sub Command22_Click()
DoCmd.OpenReport "rptGroupPapers", acViewPreview
End Sub
But when I click the button I get a message that says the report doesn't
exist!!
Anyone help?
TIA
Tony Williams
 
A

Albert D. Kallal

You need to re-check your spelling, as what you have looks just fine.

As for reports that appear in the object list...well, only reports with code
will appear in that list, but that has NOTHING to do with your problem.

Perhaps you have a space, or something else in that report. Either re-name
the report, or check the spelling....
 
T

Tony Williams

Thanks Albert, I worked on this for an hour and didn't spot the misspelling,
left it alone for a couple of hours, went back and spotted it straight away!
(Something about wood and trees comes to mind) Sorry to have wasted your
time. At least I know about the object list anyway.
Thanks again
Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top