Results 1 to 6 of 6

Thread: Access problem

  1. #1
    New Lounger
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, I have set up a combo box on a form and used conditional formatting to change the font to a red colour if a particular entry is selected, and this works as expected. I am using: "Field Value Is", "equal to", entering the same text as the combo box entry, and applying the red font colour.

    However I have now duplicated the conditional formatting options on another combo box and it refuses to honor the formatting if the relevant entry is selected, and have been unable to figure out why it won't work. Can anyone suggest what the reason might be?

    Thanks for any help you might be able to offer. Michael.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome to the Lounge!

    There are several possible explanations.

    One is that the value of the second combo box is different from what it displays. This occurs when the following conditions are met:
    - The Column Count property of the combo box is 2 (or greater).
    - The Column Widths property of the combo box starts with 0, for example 0";1".
    - The Bound Column property of the combo box is 1.
    This kind of setup is often used when the combo box looks up values in another table that has a key field and a description field. The combo box will store the key value but display the description.
    In such a situation, you must supply the key value in Conditional Formatting.

    Does that explain it?

  3. #3
    New Lounger
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='797961' date='15-Oct-2009 08:05']Welcome to the Lounge!

    There are several possible explanations.

    One is that the value of the second combo box is different from what it displays. This occurs when the following conditions are met:
    - The Column Count property of the combo box is 2 (or greater).
    - The Column Widths property of the combo box starts with 0, for example 0";1".
    - The Bound Column property of the combo box is 1.
    This kind of setup is often used when the combo box looks up values in another table that has a key field and a description field. The combo box will store the key value but display the description.
    In such a situation, you must supply the key value in Conditional Formatting.

    Does that explain it?[/quote]
    Thank you Hans; unfortunately I don't understand what you mean. However you're correct in: The combo box does look up values in another table with a key field and description field and does display the description. Do you mean I should use the field's Id number?
    Regards
    Michael

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='MichaelB' post='798011' date='14-Oct-2009 23:29']Do you mean I should use the field's Id number?[/quote]
    Yes. For example, if the Row Source of the combo box was a table like this:

    [attachment=85984:x.jpg]

    Let's say that Confections is the item you want to check for in Conditional Formatting.

    If the user selects Confections from the combo box, the value of the combo box is not Confections, but 3. So you should use 3 in the value box in Conditional Formatting.
    Attached Images Attached Images
    • File Type: jpg x.jpg (16.9 KB, 0 views)

  5. #5
    New Lounger
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, Hans; this solved the problem. However I can't understand why in two of my forms I used the field name and they worked perfectly; then the next two forms I had to use the field id but I guess if it works, who am I to question the logic of it?
    regards& thanks
    Michael

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The combo boxes on the original forms probably had only one column.

Posting Permissions

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