Connecting Tech Pros Worldwide Help | Site Map

Printing a report from a form

Jx4 Jx4 is offline
Newbie
 
Join Date: Jan 2007
Posts: 14
#1: Feb 27 '07
Hi,

I've created a database where I have a form with clients information and I also generate a report that is based on different queries. What I would like to do is print the report that matches the form of the selected client. I created a print report button, however it prints all of the reports that are created. Is there a way of printing the report that is specific to the client that is active in the form?

Thanks for any help you can give??
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,865
#2: Feb 27 '07

re: Printing a report from a form


Something like this should work...
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", , ,"[ClientID]=" & Me.ClientID
Mary
Jx4 Jx4 is offline
Newbie
 
Join Date: Jan 2007
Posts: 14
#3: Feb 27 '07

re: Printing a report from a form


Thanks for your suggestion!! I am going to try it this afternoon!!
Thanks again!


Quote:

Originally Posted by mmccarthy

Something like this should work...

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", , ,"[ClientID]=" & Me.ClientID
Mary

Newbie
 
Join Date: Feb 2007
Posts: 21
#4: Feb 27 '07

re: Printing a report from a form


Quote:

Originally Posted by Jx4

Thanks for your suggestion!! I am going to try it this afternoon!!
Thanks again!


When you give a code like this, where do you post the code in order to generate your request?
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,672
#5: Feb 28 '07

re: Printing a report from a form


Typically you would create a Command Button on your form to run the report. You would put this code in the OnClick event procedure.
Reply