Oct 19 2006, 12:06 PM
I'm trying to create a button on a form that will automatically print a report. I want to use a pull down menu and to have a report automatically generated based on the value of just the field that is selected. I've been through my Access book and can't find a straightforward explanation. I'm assuming I need a lookup field but am not sure where to go from there. Any suggestions? I'm trying to keep user interface on the reporting and query level as limited as possible. Thanks!!
Oct 19 2006, 12:09 PM
Develop a query that fetches the data for the report. The query should use the contents of the form control as its criteria value.
In the Criteria: cell of the relevant column type this:
Then base your report on the query, and put a button on the form that opens the report.
Oct 19 2006, 12:40 PM
I just tried it and am getting and "Invalid Bracketing" error when trying to run the query. I am using:
[Forms]![Print Analyst Report].[Issue List.Contract Name] where "Print Analyst Report" is the name of the form and "Issue List.Contract Name" is the name of the control. Excuse my ignorance, but have I misplaced the brackets?
Oct 19 2006, 12:42 PM
no the brackets are fine, but you should avoid using spaces and special chararcters in control/field/object names.
Try to adapt some naming convention e.g. txtContractName, frmAnaylstReport, rptAnaylstReport...!
Oct 19 2006, 12:46 PM
Nevermind...figured it out...thanks!
Oct 19 2006, 02:09 PM
Glad you got it sorted out.
Good luck on future projects!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here