Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Format on Form (Access 2000)

    I am attaching the info I am using on a form in an Excel worksheet. The database I am working in is to large to zip or send to you, so just picture the data in the excel worksheet as I describe the problem. In my Access REPORT for this information, if the Significant Field = True then I want the whole line, or detail row that is True to do something....Bold perhaps or the background behind that record in the report to turn gray or something...Anything. I'll accept any visual evidence that can be accomplished in the Report view. I know this easily done on a form, we've already done that. How about the report?
    Thanks so much
    Nannette M Padgett
    Attached Files Attached Files
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Conditional Format on Form (Access 2000)

    Look at <post#=120973>post 120973</post#> for this solution.
    However, I would use vbyellow rather than vbLightGrey, as I have found it gives a better shading on laser printers.
    HTH
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Format on Form (Access 2000)

    Will give this a try after supper...Thanks for the quick feedback
    NMPadgett
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Format on Form (Access 2000)

    I used this, and it works in Excel as I've seen before, changing the lines to different color, but this is going to be for a Conditional Format, WHERE the UnionMem field in the Report is TRUE, then I want to change the color. I am attaching a dummy database with an report included. Can you take a peek at it, and give me some ideas maybe for when the Condition is TRUE.
    NM Padgett
    Attached Files Attached Files
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Conditional Format on Form (Access 2000)

    Put this in the onformat event for the detail section of the report. then adjust the numbers to the colours you want.
    <pre>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me!UnionMem Then
    Me.Section(acDetail).BackColor = 6777215
    Else
    Me.Section(acDetail).BackColor = 16777215
    End If
    End Sub
    </pre>

    Regards
    John



  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Format on Form (Access 2000)

    John,

    Thank you from the bottom of my heart. You did it. Beautiful....What would I ever do without you folks.....You save me every time. I salute you!!!!!!!!! <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

    Nannette M. Padgett
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  7. #7
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Conditional Format on Form (Access 2000)

    Access 2000 introduced Conditional Formatting, similar to same feature in Excel. You can base conditional formatting on value of field, or on an expression. In this case I based conditional formatting on an expression, ie, UnionMem = True, to format the text fields in report Detail section in Bold font and yellow backcolor. See attached screen shot. (Select Conditional Formatting from Format menu in Report Design view.)

    HTH
    Attached Images Attached Images

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Format on Form (Access 2000)

    Mark,
    I tried this earlier today in class. I will retry it again. I found that check boxes did not allow me to use Conditional Formatting, so I did change the checkbox property to a text box, and was still having problems. I did walk through the same steps as your picture shows. However, when I return to work in the a.m., I will redo the steps and see if there was something I did wrong. I have definitly had a "typo" day...its a large possibility. Thank you for your help. As always!!!!!!!! [img]/forums/images/smilies/smile.gif[/img]
    NMPadgett
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  9. #9
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Conditional Format on Form (Access 2000)

    It's correct that you cannot apply conditional formatting to checkbox (or to section of a report, for that matter). You can apply it to other controls that support it, such as textboxes. If the conditional formatting is based on the value of a control other than the one being formatted, that's where you would use "Expression Is" rather than "Field Value Is"; the expression can refer to another control on report such as checkbox. I've attached a modified copy of the db you attached that demonstrates how this works (A2K format).

    Conditional formatting is somewhat limited, for example, as noted, you cannot apply it to an entire section of a report. You would have to use VBA in that case. I'm in habit of using VBA for conditional formatting - many of the reports I designed were originally created in Access 97, which does not support conditional formatting via the UI - however, the Conditional Formatting feature can be useful for those individuals who are VBA-phobic.

    HTH
    Attached Files Attached Files

Posting Permissions

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