"Report name you ... or macro is misspelled ... (1 Viewer)

ttomw

Registered User.
Local time
Today, 00:56
Joined
Apr 13, 2012
Messages
26
I am trying to use a list box control on a form to open reports.

  • Form name is Form1
  • Listbox control is lstReports
  • Row Source is from a table listing all report names: SELECT Reports.ReportName FROM Reports;
On Dbl Click calls a macro named ReportList: ReportList
OpenReport
ReportName =[Forms]![Form1]![lstReports]


All the reports are spelled exactly as their names are listed in the table reports.
When I try double clicking on one of the names in the list box ( which are being listed correctly) I get:
The report name "Baker Owners' you entered in either the property sheet or macro is misspelled or refers to a report that doesn't exist.
Click ok and then the Macro Single Step window opens listing:
Macro Name:
ReportList
Action Name:
OpenReport
Arguments:
Baker Owners, 2, , , Normal
Error Number:
2103

Any ideas what is going on?
Thanks,
Tom
 

Trevor G

Registered User.
Local time
Today, 08:56
Joined
Oct 1, 2009
Messages
2,341
Tom can you attach a sample of the database with the form and at least 2 reports it will be easier to take a look at an example and then help create a solution.
 

ttomw

Registered User.
Local time
Today, 00:56
Joined
Apr 13, 2012
Messages
26
Trevor,
Thanks for quick response. I solved this shortly after I posted. Extra spaces got added to the report names that were imported from Excel to the reports table. When those were removed it works fine. In the process of troubleshooting I did learn a more elegant way to source report names. Put the following in row source:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;
 

Trevor G

Registered User.
Local time
Today, 08:56
Joined
Oct 1, 2009
Messages
2,341
Tom,

Pleased to read you have resolved this and thanks for posting back.
 

Users who are viewing this thread

Top Bottom