Re: Print to Printer dispays value not on print preview of report
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Thu, 18 Jan 2007 11:47:05 -0600
AaronWestcott via AccessMonster.com wrote:
I have a report that looks back at the previous 20 years of data and prints
the values and the % change from the previous year. All the data, including
the % change are contained in a table (not my doing). I have written some
code (see below) to not display the percent change of the first year reported.
The reports previews fine but when I print the value for % change for the
first record actually prints.
More Detail: I have a field TOTCHG that has the percent change stored in it.
I created a text box to display the value contained in TOTCHG except for the
first record. The code to do this is below.
Option Compare Database
Option Explicit
Dim counter As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If counter = 0 Then
Me.Text21 = ""
Else
Me.Text21 = Me.TOTCHG
End If
counter = counter + 1
End Sub
You can not use an event procedure to calculate a value
across multiplt records. Remove the counter and figure out
another way to determine when to display the value.
I don't see the need for the extra text box, can't you just
make the TOTCHG text box visible/invisible? I would expect
the values for the first year to be different form the other
years. Isn't the value in TOTCHG Null for thefirst year?
If so, you shouldn't have to do anything.
If it's the negative of the year value, then you could use
code like:
Me.TOTCHG.Visible = (Me.TOTCHG <> -Me.yearvalue)
--
Marsh
MVP [MS Access]
.
- Follow-Ups:
- Re: Print to Printer dispays value not on print preview of report
- From: AaronWestcott via AccessMonster.com
- Re: Print to Printer dispays value not on print preview of report
- References:
- Print to Printer dispays value not on print preview of report
- From: AaronWestcott via AccessMonster.com
- Print to Printer dispays value not on print preview of report
- Prev by Date: Re: Is It Possible to Have Details Among Two Report Groupings?
- Next by Date: Re: Printing problem with Acces 2000
- Previous by thread: Print to Printer dispays value not on print preview of report
- Next by thread: Re: Print to Printer dispays value not on print preview of report
- Index(es):
Relevant Pages
|
Loading