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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Additional Serialize Functionality    
 
   
niesz
post Dec 15 2005, 11:02 PM
Post#1


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


This code was prompted by an Utter Access member who had the need to display a set number of records on every page of a report, even if the data did not work out to a multiple of the set number. For example, if you needed 6 items per page but there were 15 items total, in a standard report the last page would display only 3 items. This was an undesireable effect. They needed a full 6 records on the last page, even if this meant they would have 3 blank records at the end. The full discussion thread can be found here, but I wanted a synopsis in this thread in case the original was ever lost.

The solution I came up with used a SERIALIZE function from Stephen Lebans, which was adapted from a Microsoft Knowledge Base article and a GetLineNumber() Function.

While developing the solution for the original problem, I decided to expand upon the useability of the Serialize function. Lately I have seen quite a few posts asking how someone could add line numbering to a recordset. Also, how they could reset the numbering scheme at a given interval, or even reset the numbering scheme at a grouping level.

With the adapted code, you can achieve the following results:

1. Increment by a given value
2. Reset at Intervals of your choice
3. Reset at Grouping Levels
4. And use any of these three in combination. (Ex. Increment by 3 and reset at 30)

Examples:

CODE
ID    MyText    MyGroup    CounterResetsAtGivenGroupingLevel (MyGroup)    
nbsp;                               CounterIncrementsByGivenValue (Inc 3)
                                        CounterResetsAtGivenInterval (Reset at 6)    
                                                CounterResetsAtGivenIntervalAndIncrementsByValue (Inc by 3, Reset at 9)
1    aaa    a    1    3    1    3
2    bbb    a    2    6    2    6
3    ccc    a    3    9    3    9
4    ddd    a    4    12    4    3
5    eee    b    1    15    5    6
6    fff    b    2    18    6    9
7    hhh    c    1    21    1    3
8    iii    c    2    24    2    6
9    jjj    c    3    27    3    9
10    kkk    c    4    30    4    3
11    lll    c    5    33    5    6
12    mmm    d    1    36    6    9
17    nnn    d    2    39    1    3
18    ooo    d    3    42    2    6
19    ppp    d    4    45    3    9

Perhaps this may be of use to someone. Enjoy....
Walter Niesz
Attached File(s)
Attached File  SetRecordsPerPage.zip ( 20.06K )Number of downloads: 704
 
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    13th December 2017 - 02:00 AM