The Report Design

Now, to understand the code needed to perform the running sum task, it first involves understanding the construction of the report itself. It is assumed that you understand each of the different sections of the report generator. To help you understand the construction of the report, take a look at Figure 11-10.

W rptGalance : Report

KID

J

j ... , ... 2 ... , ... 3 ,..,... 4 ,..,... 5 ,

A

■f Report Header

{ *h kîti a ÂrtëHïitàt a

Starût

?

igBtdame

pijWt,1)

ta :::::::::: : : J

i

Mi/ÙJ >>/

^/ii/iti/- iJ

J

Purpo<

: : : : : : : : : : : : : : : : :i ; p Frarre;

::::::: i rt m in Piat f

■ ■ ■ -Amniirif

■ ■ nhfthtthf]

[

j

■f Page Footer jl i y

1 1_- b 1- u ^lr'^ll

1 i .1 rr, " "

te-'■f ,i ■ if 1

v-i-hj 'i_l-1 ■ 1 j_j n m ' li ' ra

L

¥ Report Footer

1 ■ ■ ■ ■ ff<s

pf & [PagesJ

illlB

Endin

Ï Balance:

IF

■ ■■■ Unbound

-

*L

>

Figure 11-10

Figure 11-10 shows the report designer for a running balance report. There are several important controls that are used in the VBA code of the report. These fields are listed in the following table.

Control

Property

Setting

Description

txtAmount

Controlsource

Amount Column

Bound to Amount Column in data table

txtBalance

Controlsource

Unbound

Value is set by the VBA code

Running Sum

No

Do not use the running balance.

txtBalance_

_Starting

Controlsource

Unbound

Retrieves previous ending balance from a function

txtBalance_

_Ending

Controlsource

Unbound

Value is set by the VBA code

The other properties of these controls are inconsequential to the remainder of the functionality of this example. Further, it is important to note that the Running Sum property is mentioned only to avoid any confusion, that it should be used for this example. The Starting Balance calls a VBA function to return the previous ending balance. As there may be many factors to the retrieval of this data, it is not discussed further, but instead assumed to retrieve the correct starting value for the example.

0 0

Post a comment