Jim Dettman
jimdettman at earthlink.net
Tue Feb 3 07:27:06 CST 2004
Mark, <<Honestly, at the moment, I can't even come up with understandable pseudo code. Basically, number the first page, see if it continues, add an alpha if necessary, see if it continues again, increment alpha if necessary, if not, start next page, increment page number ...loop.>> It's really not as bad as it sounds. What you'll need is two variables to track the page numbers. One for the "major" number and one for the "minor" So: 1. Declare lngMajor and lngMinor in the modules declaration section. 2. In the reports OnOpen event, set the major starting page number (pull it from a dialog form or popup a msgbox asking for the number), and lngMinor to 0. 3. In the page footers OnFormat event, you need to fill a text control with the current page number. Me![txtMyPageNumber] = Format$(lngMajor,"000") & Mid$(" ABCDEFGHIJKLMNOPQRSTUVWXYZ",lngMinor+1,1) 4. In the page headers OnPrint event, increment the page number minor variable: If PrintCount = 1 then lngMinor = lngMinor + 1 If lngMinor > 26 then what? - Not sure what you want to do here. End if 5. In the Groups Header OnPrint event, reset the page number variables: If PrintCount = 1 then lngMajor = lngMajor + 1 lngMinor = 0 End If Give that a try. Jim Dettman President, Online Computer Services of WNY, Inc. (315) 699-3443 jimdettman at earthlink.net -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mitsules, Mark S. (Newport News) Sent: Monday, February 02, 2004 2:23 PM To: '[AccessD]' Subject: [AccessD] A2K2 - Report Grouping - Page Numbering Importance: High Group, I am a neophyte in the use of "On Format", "On Print", "On Retreat", etc. when it comes to Access reports. I have a report in the format: Page Header (has no controls and is set to zero height) Group Header Detail Group Footer Page Footer This report has a rather unique page numbering scheme. Until recently, this report has been rather manageable in size and the page numbers were entered manually (please don't ask how). Now, the report size has grown to a point where I must automate the page numbering. I need your help. I originally asked related questions back in December, but didn't make any headway. Here are the requirements: I must be able to manually input the starting page number. At each change in the group header, the page number will increment by one. Now, here comes the tricky part. If a group spans more than one page (i.e. three pages), then an alpha character must be concatenated onto the page number (i.e. using the above three page example... 5, 5A, 5B). So, if the starting page number was "5" the example below would produce 5, 5A, 5B with the next page being 6. And, yes, a group footer can be pushed onto a page with no detail records. Example 2: Page 1 Page 2 Page 3 **************** **************** **************** * Page Header * * Page Header * * Page Header * **************** **************** **************** * Group Header * * Group Header * * Group Footer * **************** **************** **************** * Detail 1 * * Detail 1 * * Page Footer * * Detail 2 * * Detail 2 * **************** * Detail 3 * * Detail 3 * * Detail... * * Detail... * **************** **************** * Page Footer * * Page Footer * **************** **************** Honestly, at the moment, I can't even come up with understandable pseudo code. Basically, number the first page, see if it continues, add an alpha if necessary, see if it continues again, increment alpha if necessary, if not, start next page, increment page number ...loop. Boy...do I need help with this...both with the nested loop code logic and where to put it. TIA, Mark _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com