Results 1 to 5 of 5
  1. #1
    peterc is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    3

    Print Preview different from Print Hardcopy

    Hello All -



    I am summing a value in a list based on specific criterea in a section of a report. I display the grand total in the report footer format event in unlinked text control. When I preview the report, the grand total is correct, when I print it to hardcopy or pdf, it displays double the amount.

    I have no code in the report footer print event. This value is not modified in any except a the sub-section and the report footer.

    Also - when I print the report directly (i.e. - no preview) then the value prints correctly.

    I'm at a complete loss here - has anyone experienced a similar problem? (Access 2003 SP3 / German)

    Thanks,

    Peter
    Last edited by peterc; 10-27-2009 at 01:18 AM.

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    If you print preview the report then print does it double up?
    If you print direct without previewing does it double up?

    David

  3. #3
    peterc is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    3
    Hi David -

    when I print preview then it doubles, when I print directly then it does not double.

    Peter

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    When the report is first loaded an action/event must be taking place that calculates the summed total. When you click Print - after preview - this action/event is repeated. Now because the field already has a value it is adding the calculated value to itself, thus doubling up. Have you any code at all going on in the background?

    If you can't resolve it send me a copy to look at.
    David

  5. #5
    peterc is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    3
    David, here's all the code for the report - 'Bericht' means Report, fuss = footer, kopf = header

    Option Compare Database
    Option Explicit
    Dim dblSollPPDNR, dblSollDIN, dblSollTRB, dblSollAll As Double
    Dim boolHasAdded As Boolean
    Dim i As Integer

    Private Sub Berichtskopf_Format(Cancel As Integer, FormatCount As Integer)
    txtAllSoll = 0#
    End Sub

    Private Sub Berichtsfuß_Format(Cancel As Integer, FormatCount As Integer)
    txtAllSoll = dblSollAll
    End Sub

    Private Sub headTRB_Format(Cancel As Integer, FormatCount As Integer)
    dblSollTRB = 0#
    End Sub

    Private Sub footTRB_Format(Cancel As Integer, FormatCount As Integer)
    txtTRB_Printed = dblSollTRB
    End Sub

    'DIN - funktionsbereich

    Private Sub headDIN_Format(Cancel As Integer, FormatCount As Integer)
    dblSollDIN = 0#
    End Sub

    Private Sub footDIN_Format(Cancel As Integer, FormatCount As Integer)
    txtDIN_Printed = dblSollDIN
    End Sub

    'PPDNR
    Private Sub headPPDNR_Format(Cancel As Integer, FormatCount As Integer)
    dblSollPPDNR = 0#
    boolHasAdded = False
    End Sub

    Private Sub footPPDNR_Format(Cancel As Integer, FormatCount As Integer)
    txtPPDNR_Printed = dblSollPPDNR

    If IsNull(txtRoomCount) Then
    txtFunction = [Funktion]
    Else
    txtFunction = [Funktion] & " Gesamt: "
    End If

    If boolHasAdded = False Then
    dblSollDIN = dblSollDIN + dblSollPPDNR
    dblSollTRB = dblSollTRB + dblSollPPDNR
    dblSollAll = dblSollAll + dblSollPPDNR
    boolHasAdded = True 'need this as on page change this event fires twice`?
    'Debug.Print txtBezeichnung & " " & dblSollPPDNR
    'Debug.Print Text60
    End If
    End Sub

    Private Sub Detailbereich_Format(Cancel As Integer, FormatCount As Integer)
    If dblSollPPDNR = 0 Then
    dblSollPPDNR = txtPPDSoll
    End If
    If IsNull(txtRoomCount) Then
    Cancel = True
    End If
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 09-26-2009, 07:17 AM
  2. Error when trying to print or print preview
    By TriAdX in forum Reports
    Replies: 8
    Last Post: 08-25-2009, 08:20 AM
  3. add a print button
    By gromit95 in forum Forms
    Replies: 0
    Last Post: 08-13-2008, 07:28 AM
  4. PRINT SUPERPOSSITION
    By sergiogs in forum Access
    Replies: 0
    Last Post: 04-10-2007, 09:24 AM
  5. print form
    By vam in forum Forms
    Replies: 0
    Last Post: 05-02-2006, 07:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums