Prev: Strange Lookupbox
Next: Creating a template
From: KenSheridan via AccessMonster.com on 26 Apr 2010 13:24 Provided that the database window is not being hidden at start-up. As the report object is selected in the database window by virtue of the InDatabaseWindow argument of the SelectObject method, this will expose the database window. While it can be hidden at start-up via the interface or by setting the StartupShowDBWindow property with code, I'm not aware of any way of hiding it again once shown without restarting the application. The other option of course is to print multiple sets of the same data in a single report by including a table with a column of sequential numbers in its underlying query, restricting the query by a parameter on this column and grouping the report on the column, forcing a new page after each group. If the pages are numbered the page numbering also needs to be re-initiated after each group. Ken Sheridan Stafford, England fredg 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. > -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1
From: Alu_GK on 27 Apr 2010 01:09 Thanks for your answers !! The way I publish my application is - In a Access runtime 2003 environment, and MDE file that hides the DB Window If DBWindow needs to be opened with the SelectObjet Method, and this method show the DB window, how it will behave under my customers environmet ? THANKS -- Alu_GK "KenSheridan via AccessMonster.com" wrote: > Provided that the database window is not being hidden at start-up. As the > report object is selected in the database window by virtue of the > InDatabaseWindow argument of the SelectObject method, this will expose the > database window. While it can be hidden at start-up via the interface or by > setting the StartupShowDBWindow property with code, I'm not aware of any way > of hiding it again once shown without restarting the application. > > The other option of course is to print multiple sets of the same data in a > single report by including a table with a column of sequential numbers in its > underlying query, restricting the query by a parameter on this column and > grouping the report on the column, forcing a new page after each group. If > the pages are numbered the page numbering also needs to be re-initiated after > each group. > > Ken Sheridan > Stafford, England > > fredg 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. > > > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1 > > . >
From: KenSheridan via AccessMonster.com on 27 Apr 2010 07:28
Even when a file is converted to a .mde file with the database window hidden, selecting an object in the database window with the SelectObject method will expose the database window. I haven't tested it in a true runtime environment, but if the file is opened in runtime mode from a command line with the /runtime switch the database window is also exposed in this way. Personally, I would in most cases use the second method I outlined in my reply to Fred when multiple copies of a report are needed. You just need to create a table named Counters say, with one integer number column Counter and fill it with numbers from 1 to whatever is the maximum number you'll need. You then base the report on a query which includes the Counters table, with a parameter on the Counter column for the user to enter the number of copies to print, e.g. SELECT Counter, YourCurrentTableOrQuery.* FROM YourCurrentTableOrQuery, Counters WHERE Counter <= [Enter number to print:]; The inclusion of the Counters table without explicitly joining it to the main table or query will produce the 'cartesian product' of the two, i.e. very row in one is joined to every row in the other. So by restricting the number of rows from Counters returned by means of the parameter, the query returns the data multiple times depending on the value entered. The report should be grouped first on Counter, giving the group a zero-height group footer, and the footer's ForceNewPage property set to 'After Section'. This will cause each new set of data to start on a new page. To reinitiate page numbering for each copy put the following in the group footer's Format event procedure; Page = 1 If you want the report to show Page # of ## for each group in the page footer you can use James Brooks' code from: http://www.mvps.org/access/reports/rpt0013.htm You need to also include a hidden text box in the page footer with a ControlSource of =Pages for this to force two iterations through the report. The reference to the SalesPerson control in his code would be changed to Counter and you'll need to include a hidden control bound to the Counter field in the group footer. Ken Sheridan Stafford, England Alu_GK wrote: >Thanks for your answers !! > >The way I publish my application is - In a Access runtime 2003 environment, >and MDE file that hides the DB Window >If DBWindow needs to be opened with the SelectObjet Method, and this method >show the DB window, how it will behave under my customers environmet ? >THANKS >> Provided that the database window is not being hidden at start-up. As the >> report object is selected in the database window by virtue of the >[quoted text clipped - 30 lines] >> >same form as the HowMany control, you can use Me.HowMany instead of >> >Forms!FormName!HowMany. -- Message posted via http://www.accessmonster.com |