UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Report generating button on Form    
 
   
mwilliams
post Oct 19 2006, 12:06 PM
Post #1

New Member
Posts: 3



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!!
Go to the top of the page
 
+
fkegley
post Oct 19 2006, 12:09 PM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



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:

[Forms]![NameOfForm].[NameOfControl]

Then base your report on the query, and put a button on the form that opens the report.
Go to the top of the page
 
+
mwilliams
post Oct 19 2006, 12:40 PM
Post #3

New Member
Posts: 3



Thanks!!

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?
Go to the top of the page
 
+
freakazeud
post Oct 19 2006, 12:42 PM
Post #4

UtterAccess VIP
Posts: 31,413
From: NC, USA



Hi,
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...!
HTH
Good luck
Go to the top of the page
 
+
mwilliams
post Oct 19 2006, 12:46 PM
Post #5

New Member
Posts: 3



Nevermind...figured it out...thanks!
Go to the top of the page
 
+
freakazeud
post Oct 19 2006, 02:09 PM
Post #6

UtterAccess VIP
Posts: 31,413
From: NC, USA



Glad you got it sorted out.
Good luck on future projects!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 08:01 AM