Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2009
    Posts
    223

    Angry Unanswered: Conditional Formatting - the Text Box

    I have no trouble formatting the font and background for a Text Box depending upon some other value.

    But I do not seem to be able to format the font and background when I disable a Text Box using the Conditional Formatting Rules Manager?

    When I click the “disable” button in the Conditional Formatting Rules Manager, the Text Box is disabled but it has a white background. And the text of the associated Label turns to gray?

    Is there anyway I can define the text and background when I disable a Text Box using the Rules Manager?

    Thanks.
    What would you attempt to do if you knew you would not fail?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    doubt it
    sounds like when you disable the control ithe report uses the default settings as part of your windows layout.

    if you want to tinker beyond the basic given under the conditional formatting consider placing some code in the controls on format event.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Is this question dealing with a Report? I assumed we were talking about a Form. If so, you could possibly use Conditional Formatting to set the colors for your 'disabled' Textbox, and then, using the same condition, set the Locked Property of the Textbox to Yes, using code in the Form_Current event, as well as, if appropriate, the AfterUpdate event of the Control holding the 'other data.'

    While most conditional formatting done thru the Form_Current event will only work on a Single View Form, Locking or Locking/Disabling the Control can be done on any type of Form, including Continuous or Datasheet View Forms, because this type of formatting doesn't change the appearance of the Control. And when a given Record is the Current Record, its Control will be Locked or Not Locked, appropriately!

    Linq ;0)>
    Last edited by Missinglinq; 11-12-12 at 01:52.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Nov 2009
    Posts
    223
    Guys, many thanks for your feedback - it is appreciated.

    Yes, this is a Form question.Unfortunately, I am confused with many of the terminologies in the replies and I am still stuck.

    The easiest way seems to be putting some code in the 'On Format" event in the Control Property Sheet - but I can't find it?? Maybe it has a different name in Access 2010?
    What would you attempt to do if you knew you would not fail?

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Accessing the Conditional Format feature is the same in Acc 2012 as it was in the former versions. When the form is in Design view, right-click on a TextBox and in the contextual (popup) menu select "Conditional format". A dialog box then opens, in which you can create "rules" that, when applied, will change the format of the TextBox if a condition or an expression defined in this "rule" is true (or false). You can have several rules for the same control.
    Have a nice day!

  6. #6
    Join Date
    Nov 2009
    Posts
    223
    Yup, I got the Conditional Formatting area.

    I am now looking for a way that I can define the text and background when I disable a Text Box using the Rules Manager, or maybe the 'On Format' box?
    What would you attempt to do if you knew you would not fail?

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by reddevil1 View Post

    ...I am now looking for a way that I can define the text and background when I disable a Text Box using the Rules Manager...
    I think healdem was referring to the Detail_Format event of a Report, not a Form, which was why I posed the question as to which we were dealing with, here!

    As for your question, above, refer to my initial post! You need to approach this in two parts! You need to use your condition to
    1. Format the Foreground and Background colors using Conditional Formatting.
    2. Disable the Control by using code in the FormCurrent event to Lock or Lock/Disable it, not by using the Conditional Formatting Dialog box!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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