473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Conditional Formatting

20
Hello,

Im trying to use conditional formatting in a text box on a form.

What im trying to do is that conditional formatting changes the colour of the text in the text box. I need the conditional formatting to look up another text box.

This is what i need:
i have one text box which is called colour and it shows various colours.
What i would like to do is in the other text box with conditional formatting is for the text box to change colour but only when there are certain colours in there.

For example i have these colours in my colour text box,

Red, Blue, Black, Green, Yellow.
What i would like is for the conditional formatting to work when the colour Red, Blue or Yellow is in the text box.

Can you please suggest the best way to do this.
If you need any more information please ask
Jun 27 '07 #1
1 1659
FishVal
2,653 Expert 2GB
Hello,

Im trying to use conditional formatting in a text box on a form.

What im trying to do is that conditional formatting changes the colour of the text in the text box. I need the conditional formatting to look up another text box.

This is what i need:
i have one text box which is called colour and it shows various colours.
What i would like to do is in the other text box with conditional formatting is for the text box to change colour but only when there are certain colours in there.

For example i have these colours in my colour text box,

Red, Blue, Black, Green, Yellow.
What i would like is for the conditional formatting to work when the colour Red, Blue or Yellow is in the text box.

Can you please suggest the best way to do this.
If you need any more information please ask
Hi!

Here is an example of how you can change FormatCondition(0).Forecolor in txtCondFrmt textbox, handling an AfterUpdate event in txtColor textbox where colorname is inputted.

Assumed:
  • [txtCondRfmt] has at list one conditional formatting and only the first is to be changed
  • color name is entered as text to [txtColor]
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtColor_AfterUpdate()
  2.     With Me.txtCondFrmt.FormatConditions(0)
  3.         Select Case Me.txtColor
  4.             Case "Red"
  5.                 .ForeColor = vbRed
  6.             Case "Blue"
  7.                 .ForeColor = vbBlue
  8.             Case "Yellow"
  9.                 .ForeColor = vbYellow
  10.         End Select
  11.     End With
  12. End Sub
  13.  
This is not more than simple example.
Certainly a working version may be more nice.
Jun 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
8
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
2
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
1
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of...
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
2
by: Filips Benoit | last post by:
Dear All, Access 2003 adp on SQL_server 2005 A continious form showing 1 month based on table 'CALENDAR_MONTH_GRID' and fill with a SP. Fields: Companyname, Day1, day2, etc. The value in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.