Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print Error Transactions Only or All? ((a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Print Error Transactions Only or All?
    (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a report that prints a list of transactions.

    In the Detail_Format section I have the following code that flags the detail line with the appropriate error message if neccessary.

    The report prints OK

    How can I modify the report to just print the error transaction lines?

    I would like to have just one report that I could start from a Form in one of the following two modes:

    1. Print All Transactions
    2. Print Error Transactions Only

    <pre>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    Dim curAmount2 As Currency
    Dim lngTotalError As Long
    Select Case Code
    Case "201", "202", "203", "204"
    curAmount2 = curFee + curLocal + curSurcharge
    If curAmount2 <> curAmount Then
    Error = "BalEr"
    lngTotalError = lngTotalError + 1
    Else
    Error = ""
    End If
    If Error = "" Then
    If lngSerChgCount > 0 And curSurcharge = 0 Then
    Error = "ScErr"
    lngTotalError = lngTotalError + 1
    Else
    If lngSerChgCount = 0 And curSurcharge > 0 Then
    Error = "ScErr"
    lngTotalError = lngTotalError + 1
    Else
    Error = ""
    End If
    End If
    End If
    If Error = "" Then
    Select Case Code
    Case "201", "202"
    If lngSerChgCount > 0 And curSurcharge > 0 Then
    Error = "ScErr"
    lngTotalError = lngTotalError + 1
    Else
    Error = ""
    End If
    Case Else
    End Select
    End If
    Case "214", "215"
    curAmount2 = lngCount * curFee
    If curAmount2 <> curAmount Then
    Error = "BalEr"
    lngTotalError = lngTotalError + 1
    Else
    Error = ""
    lngTotalError = lngTotalError - 1
    End If
    End Select
    End Sub
    </pre>


  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Error Transactions Only or All? ((a2k (9.0.6926) SP-3 Jet 4.0 SP

    You could use the where condition of the DoCmd.OpenReport.
    Something like :
    <code>DoCmd.OpenReport "YourReport", , , "[Code] = '201' OR [Code] = '202'"</code>
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •