Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Conditional formatting

    A field on one of my reports has one possible value that is an exact duplicate of a possible value in an adjacent field. Certain records display the value "Contractor" side-by-side in adjacent columns. Just looks weird, y'know. I'd like to use conditional formatting to make the field invisible whenever the value is "Contractor." I've tried writing an expression in the conditional formatting box, but it's not working. The expression reads

    <font face="Georgia"> IIf([PositionID]=37,[Visible]=True,[Visible]=False)</font face=georgia>

    The number 37 is the PositionID (AutoNumber). I've tried using the word "Contractor" instead of the PositionID number, but neither works. I don't write enough expressions to be real handy with this stuff. What's the solution, please. Thanks!

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Conditional formatting

    It might just be easier to change the dataset feeding the report. You could go into design mode of the report and then select properties, data source. In the data source, change the report criteria to do what you want. For example, if your data source was a query, then use an If statement on the field you do not want to see. Something like

    IIf([Field2] = [Field1],"",[Field2[) on the data source would make the second field appear to be empty if it equals the first field.

    You cant turn the control on the report invisible in your case as some data would instruct the control to be visible and other data invisible. Change the data instead that feeds the report.

    HTH - I am sure there are other ways to do this as well.
    Regards,

    Gary
    (It's been a while!)

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

    Re: Conditional formatting

    I use something like this in Report Detail_Format section

    If IsNull(strBusinessNameA) Then
    lblBusinessName.Visible = False
    Else
    lblBusinessName.Visible = True
    End If

    HTH, John

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Conditional formatting

    Oo-o-o...that looks promising! Thanks for the tip! I'll try it after the Thanksgiving holiday.

Posting Permissions

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