Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform results (2003)

    I have a subform that returns a description based on matching invoice numbers. The source object in my form is like so...

    Source Object: Report.Invoice Descriptions

    Is there a way to return a value, like "Payment Received" is there is no result returned. I know I can do it with a typical field, but not sure if I can with a subform when no result is found.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform results (2003)

    I'm not sure what a subform has to do with this (and why the source object of the subform is a report), but perhaps you can use a text box with a control source like the following:
    <code>
    =Nz([Description],"Payment Received")
    </code>
    where Description is the name of the description field.
    Note: the text box should not have the same name as the description field, that would result in a circular reference.

    If that doesn't help, please try to provide a clearer description of what you are doing, and possibly attach a stripped down copy of the database.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform results (2003)

    My apologies. I meant to type Subreport. Unfortunately, the Subreport returns no blanks. My final results sometimes lists a line item which is not an invoice. As a result, there is no matching invoice description and it returns nothing. I'm thinking I probable need to do this with code. You had given me an example before where I included an event procedure on the section like so...

    Option Compare Database

    Private Sub OwnerHeader_Format(Cancel As Integer, FormatCount As Integer)
    Me.Unit.Visible = Not IsNull(Me.UnitNum)
    End Sub

    My only issue now, is I'm dealing with a subreport and I want to return text versus nothing at all.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform results (2003)

    Perhaps you can place a text box on top of the subreport, with control source
    <code>
    =IIf([Invoice Descriptions].[Report].[HasData],Null,"Payment Received")
    </code>
    If the subreport has data, the text box will be blank, otherwise it'll display the text "Payment Received". Replace Invoice Descriptions with the name of the subreport as a control on the main report.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform results (2003)

    Genious. Do you ever take anytime off. Thanks again!!!

Posting Permissions

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