Prev: Strange Lookupbox
Next: Creating a template
From: Alu_GK on 26 Apr 2010 00:54 Hello - I've seen some of the solution given here to print a report without opening it in preview. the solution was docmd.openreport, acNormal My problem is - how can I control the number of copies to print with this command ? in the printout function i have a "copies" parameter. is here i have no parameter that relate to the number of copies. Is any one has an idea how to solve it ? Thanks. -- Alu_GK
From: Wayne-I-M on 26 Apr 2010 03:26 One method would be to create a text box on your form (called PrintNumber) then refer to it in the call to print like this OnClick or another event DoCmd.OpenReport "ReportName", acViewPreview, "", "", acNormal DoCmd.PrintOut acPrintAll, , , , Me.PrintNumber DoCmd.Close acReport, "ReportName" or, if you always want to the same number of reports printed just change the code to show the number (like this to print 7 copies) DoCmd.PrintOut acPrintAll, , , , 7 -- Wayne Manchester, England. "Alu_GK" wrote: > Hello - > I've seen some of the solution given here to print a report without opening > it in preview. > the solution was > > docmd.openreport, acNormal > > My problem is - how can I control the number of copies to print with this > command ? in the printout function i have a "copies" parameter. is here i > have no parameter that relate to the number of copies. > Is any one has an idea how to solve it ? > Thanks. > -- > Alu_GK
From: KenSheridan via AccessMonster.com on 26 Apr 2010 06:11 A simple solution would be to call the OpenReport method repeatedly in a loop: Dim n As Integer Dim intNumber as Integer intNumber = <get the number to print from somewhere> For n = 1 To intNumber DoCmd.OpenReport "YourReportName" Next n Ken Sheridan Stafford, England Alu_GK wrote: >Hello - >I've seen some of the solution given here to print a report without opening >it in preview. >the solution was > >docmd.openreport, acNormal > >My problem is - how can I control the number of copies to print with this >command ? in the printout function i have a "copies" parameter. is here i >have no parameter that relate to the number of copies. >Is any one has an idea how to solve it ? >Thanks. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1
From: Alu_GK on 26 Apr 2010 12:04 Hello - the solution with the loop is the solotion that will work for me. the other solution is what i did before, but i don't want to open and preview the report, it is slow things down in the system. Thanks for your answer. and thank you also Wayne-I-M. -- Alu_GK "KenSheridan via AccessMonster.com" wrote: > A simple solution would be to call the OpenReport method repeatedly in a loop: > > > Dim n As Integer > Dim intNumber as Integer > > intNumber = <get the number to print from somewhere> > > For n = 1 To intNumber > DoCmd.OpenReport "YourReportName" > Next n > > Ken Sheridan > Stafford, England > > Alu_GK wrote: > >Hello - > >I've seen some of the solution given here to print a report without opening > >it in preview. > >the solution was > > > >docmd.openreport, acNormal > > > >My problem is - how can I control the number of copies to print with this > >command ? in the printout function i have a "copies" parameter. is here i > >have no parameter that relate to the number of copies. > >Is any one has an idea how to solve it ? > >Thanks. > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1 > > . >
From: fredg on 26 Apr 2010 12:50
On Mon, 26 Apr 2010 09:04:02 -0700, Alu_GK wrote: > Hello - > the solution with the loop is the solotion that will work for me. > the other solution is what i did before, but i don't want to open and > preview the report, it is slow things down in the system. > Thanks for your answer. > and thank you also Wayne-I-M. You can use the SelectObject and PrintOut methods together to print X copies of the report without opening it in Preview. DoCmd.SelectObject acReport, "ReportName", True DoCmd.PrintOut acPrintAll, , , , Forms!FormName!HowMany where Forms!fFormName!HowMany is the form name and control name that contains the number of copies you wish printed. If this code is on the same form as the HowMany control, you can use Me.HowMany instead of Forms!FormName!HowMany. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |