Re: Print to Printer dispays value not on print preview of report



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]
.



Relevant Pages

  • Re: Updating records with form field type select
    ... "Daniel Crichton" wrote: ... the display in the users edit form is the first record in the ... I'm not sure how to make it display the record from the db. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Need help with multiple tables and portals
    ... Perhaps the issue is that you are viewing in Table View, which would only display the first value from Table C? ... The application is used to catalog images. ... What IS a problem is that Table B actually has its own one-to-many relationship with Table C (each record in Table B may have links to multiple records in Table C) and I need to include some data from that table as well. ... I was able to get this set up, but I only seem to be able to get the first record from Table C. ...
    (comp.databases.filemaker)
  • Re: missing subform data
    ... I backup very frequently but didn't note developmental changes. ... My main client form has several tab controls with subforms. ... Upon Access launch some of those subforms on the first record do not ... How do I get it to display out of the gate? ...
    (microsoft.public.access.forms)
  • Re: null data when creating a new record
    ... > i am using access 2000 with custom forms. ... > i would like the form to display blank data when i am creating a new ... In that case then yes the form will open at the first record unless you do ... With that applied the form always opens at a new blank record position. ...
    (microsoft.public.access.formscoding)
  • Re: missing subform data
    ... My main client form has several tab controls with subforms. ... Upon Access launch some of those subforms on the first record do not ... How do I get it to display out of the gate? ...
    (microsoft.public.access.forms)

Loading