Printing Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wayneyh
    New Member
    • Mar 2008
    • 67

    Printing Problem

    Can anyone help me? I have put this bit of code into my database and i can see the results on screen but when i go to print the report it is linked to it doesn't print the information but it prints the rest of the report fine.
    [code=vb]Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)

    If (Me.[Paid] = False) Then
    Me.labelPaid.Vi sible = False
    Me.PaidDate.Vis ible = False
    Me.PaymentMetho d.Visible = False
    Me.PaymentNumbe r.Visible = False
    Else
    Me.labelPaid.Vi sible = True
    Me.PaidDate.Vis ible = True
    Me.PaymentMetho d.Visible = True
    Me.PaymentNumbe r.Visible = True
    End If

    End Sub[/code]
    Last edited by Stewart Ross; Mar 14 '08, 11:27 AM. Reason: code tags added
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. Your code is ok, as long as the control called Paid on your report is indeed a boolean (true/false) value, and when it runs it should hide or show the controls in the detail section of your report accordingly. When you say that the report does not print the information, can you advise whether or not the controls concerned are always being shown, always being hidden, or what?

    -Stewart

    Comment

    • Wayneyh
      New Member
      • Mar 2008
      • 67

      #3
      Originally posted by Stewart Ross Inverness
      Hi. Your code is ok, as long as the control called Paid on your report is indeed a boolean (true/false) value, and when it runs it should hide or show the controls in the detail section of your report accordingly. When you say that the report does not print the information, can you advise whether or not the controls concerned are always being shown, always being hidden, or what?

      -Stewart
      The checkbox called Paid is a (true/false) value. If it is checked on the Form PaymentConfirma tion then it shows the information on the report. This works fine as i can see it on the screen until i want to print the report off. All the information on the report prints fine apart from the information from the code below which doesn't come out on the print out. the information is being pulled from a query. Do i have to put this code into the query or the form before it reaches the report for it to work?


      Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
      If (Me.[Paid] = True) Then
      Me.labelPaid.Vi sible = True
      Me.PaidDate.Vis ible = True
      Me.PaymentMetho d.Visible = True
      Me.PaymentNumbe r.Visible = True
      Else
      Me.labelPaid.Vi sible = False
      Me.PaidDate.Vis ible = False
      Me.PaymentMetho d.Visible = False
      Me.PaymentNumbe r.Visible = False
      End If
      End Sub

      Comment

      • Stewart Ross
        Recognized Expert Moderator Specialist
        • Feb 2008
        • 2545

        #4
        Originally posted by Wayneyh
        The checkbox called Paid is a (true/false) value. If it is checked on the Form PaymentConfirma tion then it shows the information on the report. This works fine as i can see it on the screen until i want to print the report off. All the information on the report prints fine apart from the information from the code below which doesn't come out on the print out. the information is being pulled from a query. Do i have to put this code into the query or the form before it reaches the report for it to work?
        Hi. The code is fine - you don't have to place this anywhere other than where it is for it to do its job. However, you say in your reply that Paid is on your form. It is not the form which matters - the field Paid must be included in the query on which your report is based, and it must also be included as a control in the detail section of your report. You can set the properties for the control to Visible=No to hide it if you wish not to see it, but it must be present on your report. If it is not there the DetailFormat code will not be able to refer to it and test its value.

        I am wondering if you are actually referring to two different things here - I would guess the use of a single check box on the form which is to be ticked to show all values paid and unticked to show all values not paid, with the need to show or hide particular controls on your report. If, as I suspect, this is the case there are other ways to do it. Please let me know in your next response.

        -Stewart

        Comment

        • Wayneyh
          New Member
          • Mar 2008
          • 67

          #5
          Originally posted by Stewart Ross Inverness
          Hi. The code is fine - you don't have to place this anywhere other than where it is for it to do its job. However, you say in your reply that Paid is on your form. It is not the form which matters - the field Paid must be included in the query on which your report is based, and it must also be included as a control in the detail section of your report. You can set the properties for the control to Visible=No to hide it if you wish not to see it, but it must be present on your report. If it is not there the DetailFormat code will not be able to refer to it and test its value.

          I am wondering if you are actually referring to two different things here - I would guess the use of a single check box on the form which is to be ticked to show all values paid and unticked to show all values not paid, with the need to show or hide particular controls on your report. If, as I suspect, this is the case there are other ways to do it. Please let me know in your next response.

          -Stewart
          Yes that is correct. Please advise

          Comment

          • Stewart Ross
            Recognized Expert Moderator Specialist
            • Feb 2008
            • 2545

            #6
            Originally posted by Wayneyh
            Yes that is correct. Please advise
            OK. I am taking it that you are confirming that there is a single check box on your form which filters the form to show paid or unpaid records, and you want to implement this for your report.

            You need to provide more information about what is in the query on which your report is based. In particular, I need to know the names of the main fields of this query which are of interest in showing and hiding payment details. I would also appreciate a copy of the After Update code for the checkbox in your form, as this will tell me how the form is being filtered to show only the paid or unpaid records.

            -Stewart

            Comment

            • Wayneyh
              New Member
              • Mar 2008
              • 67

              #7
              Originally posted by Stewart Ross Inverness
              OK. I am taking it that you are confirming that there is a single check box on your form which filters the form to show paid or unpaid records, and you want to implement this for your report.

              You need to provide more information about what is in the query on which your report is based. In particular, I need to know the names of the main fields of this query which are of interest in showing and hiding payment details. I would also appreciate a copy of the After Update code for the checkbox in your form, as this will tell me how the form is being filtered to show only the paid or unpaid records.

              -Stewart
              I have managed to fix the problem. Thanks for your help anyway.

              Comment

              • Stewart Ross
                Recognized Expert Moderator Specialist
                • Feb 2008
                • 2545

                #8
                Originally posted by Wayneyh
                I have managed to fix the problem. Thanks for your help anyway.
                I am very glad you were able to fix this; would you mind telling us what you did to resolve your problem? It may help others who read the forum too.

                Thanks

                -Stewart

                Comment

                Working...