Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Formating (97/2K/2K2)

    <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>

    I have a frontend I developed in Access 2K2 on which I use Conditional formating on several forms to great effect. I translated the Frontend to '97 and everything works accept the conditional formating. Does Access '97 not support conditional formating? Is the only way around this through writing code for each control?

    Thanks

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

    Re: Conditional Formating (97/2K/2K2)

    Sorry, but conditional formatting was introduced in Access 2000. Code is your only option in A97.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formating (97/2K/2K2)

    Thanks Charlotte, I was afraid of that.

  4. #4
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formating (97/2K/2K2)

    <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>

    Ok, I have played around a bit and am having trouble coming up with the right code onhte right event to mimic the conditional formating I was using. Here's the set-up:

    I have a Form that tracks Jobs, with a subform that tracks tasks with Complete By and Complete Date fields. Information is entered on a seperat form for the task completion, and results a reflect in the subform, which id a continous form. I want to change the background color of the compby and compdate text boxed if ther is anything in the field for that record. Some records may have initials and a date and be turned green, other records may have nothing and be Red.

    Any idea's? Thanks

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

    Re: Conditional Formating (97/2K/2K2)

    I have attached a demo database originally designed by Lounger <!profile=SteveH>SteveH<!/profile>. It demonstrates a simple way to change the background color of a text box in a continuous form in any version of Access, without using any code. The "magic" part is the table tblColours. It contains 1x1 pixel bitmap images of the available colors.
    Attached Files Attached Files

  6. #6
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formating (97/2K/2K2)

    <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>

    Hans, what a great little trick! Perhaps it's too early and I'm being thick, but what am I missing? How is the backgroung color changing when you select a different color from the pull-down? I see the link in the query, but I don't see any code, or macros. How do it know?! (b.t.w... I converted it into A2K format from 97)

    Thanks, Keith

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

    Re: Conditional Formating (97/2K/2K2)

    Hi Keith,

    Open the form (frmSeveral) in design view.
    Select OleColour from the Object dropdown list in the Formatting (Form/Report) toolbar.
    This is a bound object frame that covers the entire Detail section of the form. It is bound to the Colour field in the Record Source of the form, and utlimately originates in the tblColours table. Although the Colour field in the table contains 1 by 1 pixel images, they fill the entire OleColour control since the Size Mode property of this control has been set to Stretch. This is the "magic" that makes it appear as if the background of the detail section changes colour. In fact, it's the OleColour control that changes, not the Detail section.

    If you select another color from the dropdown list in the form, you are actually changing the ColorIndex field in tblData. In qrySeveralColours, the ColorIndex field in tblData is linked with the Value field in tblColours, so the corresponding Colour is automatically looked up.

    Clear as mud now? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  8. #8
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formating (97/2K/2K2)

    <P ID="edit" class=small>(Edited by charlotte on 23-Oct-03 06:13. for language)</P> <img src=/S/jollyroger.gif border=0 alt=jollyroger width=29 height=18>

    weeellll... slap my <img src=/w3timages/censored.gif alt=censored border=0>! That's cool!

    Now to get it to respond to a text box having (or not having) data? I'm gonna give it a shot, and come back if I get stuck. Thanks for your enlightenment, Hans!

  9. #9
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formating (97/2K/2K2)

    OK, I'm stuck in the muck again. I need to change colors based on the existance of a date in a text box on a repeating form. If a date has been entered, I wan't the color to change. I am fine with using a Bound Object Fram in the background as in the example, but I can't figurout how to get the linkage throught the query based on a Not Null condition. Any Ideas? Should I try this another way?

    In another location, I want to change colors based on the value of the date relative to Now(). hopfully there is one solution to satisfy both of these needs.

    Thanks, Keith

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

    Re: Conditional Formating (97/2K/2K2)

    You must create a link between the Not Null condition and the color. For instance, IsNull([DateField])+2 is 1 if the date field is null, 2 otherwise (because True = -1 and False = 0.) So, you can link the data table to the color table by this value. See attached database.

    What exactly do you want in your second question?
    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
  •