Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Unanswered: Conditional Formatting in Report

    What I need is:

    [Monetary Field] in the detail section of a report.

    If field is less than 1 then show text "NO DATA FOR THIS CITY"

    Any suggestions?

    Thanks . . . Rick

  2. #2
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    Rick--

    What I have done in the past is create a text box or label (don't remember) that the background is set to NOT transparent. Then I set the visible property to false. In the Detail_Format event check your condition and if it's less than 1 set the visible property of the text box to true. Make sure that the text box covers any other controls that you have so that they appear hidden when the text box is visible.

    C

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    use an iif() statement.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Sep 2010
    Posts
    32
    Quote Originally Posted by Rick Schreiber View Post
    What I need is:

    [Monetary Field] in the detail section of a report.

    If field is less than 1 then show text "NO DATA FOR THIS CITY"

    Any suggestions?

    Thanks . . . Rick

    IIf([Monetary Field] = < 1, "NO DATA FOR THIS CITY", Val(Nz([Monetary Field], 0)))


    That should work for you

  5. #5
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Iff Statement Error . . .

    Here is the exact error using the Iff statement . . .

    Syntax Error (missing operator) in query expression'[IIF([Curr Yr median close price] = <1 ,"NO DATA", Val(Nz([Curr Yr median close price],0)))]'.

    Uhhh . . . [Curr Yr median close price] is calculated from a complex query.

    Did I fail to mention that!

    The text box suggestion looks interesting but not sure about using text boxes in place of fields from the fields list on a report and setting true or false parameters.

    Thanks for your help.

    Rick

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ditch the outer square brackets.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Outer Square Brackets

    I included those brackets as they are exactly how the error message was displayed.

    The answer to my original problem is this.

    1. Create a small text box. Delete the text box label.
    2. Place the text box in left most section of the detail records. Format font & field size to match detail records.
    3. Select the text box and then "Properties"
    4. Control source set to: =1
    5. Format: General Number
    6. Decimal Places: 0
    7. Running Sum: Over All

    Googled and found it on the Internet.

    Works great!

    Thanks everyone for your help on this.

    Rick

Posting Permissions

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