Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HasData Repeats or Errors (2002, sp2)

    I have a subreport named Payments. It is based on the Payments table. It's grouped by client name and the footer has a total named "sum payments".

    In my report I'm trying to set up a HasData text box to display "sum payments" or 0. I have tried it two different ways, the one way it gives a name error, the other way it repeats the first client's payment for each client.

    The name error expression looks like this: =IIf(Payments.HasData,Sum([payment]),0)

    The repeating one looks like this: =IIf(Payments.Report.HasData,Payments![sum payments],0)
    Notice that Access keeps taking out my square parenthesis from the name of the report! Why!!

    Thanks in advance!
    egghead

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: HasData Repeats or Errors (2002, sp2)

    I suspect Access is getting confused between the subreport and the table, since they have the same name. Using the Report method to get at the properties of the subreport at least clarifies that. It isn't at all clear what you're trying to accomplish and why you're trying to use HasData to do it. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasData Repeats or Errors (2002, sp2)

    Well, it's an invoice that has a beginning balance, a group of up to three charges, a minimum payment amount and, now, a payment. This ultimately should calculate to a running total of the amount due.

    Some of the clients don't have entries for all the charges, lets say "mileage charges", so the subreport didn't display a result. I used a text box and the HasData to get the mileage charge to show the actual or zero. It worked great.

    Now I'm working on adding the payments to the invoice, and thought I would use the HasData again, to display either the payment or a zero.

    That is the crux of what I'm trying to do (trying being the important word!!).
    egghead

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: HasData Repeats or Errors (2002, sp2)

    So you're running this in the subreport itself? In that case, why are you referring to Payments at all if that is the subform you are currently in? Try Me.Report.HasData
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasData Repeats or Errors (2002, sp2)

    No the payments is a subreport in my Invoice report. Hard to explain! Because not all of the accounts have payments, I thought I had to put the hasdata in a text box on the Invoice report to get either a value or a zero.
    egghead

  6. #6
    Lounger
    Join Date
    Nov 2001
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HasData Repeats or Errors (2002, sp2)

    =IIf([Payments].[Report].[HasData],[Payments].[Report]![sum payments],0)

Posting Permissions

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