473,385 Members | 1,347 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,385 software developers and data experts.

Changing textbox color by entering color name

Hello everyone.

I would like to have a text box with a code that would allow changing text color depending on the name of the colour. For instance, if i type in "GREEN" the colour of text GREEN should be in green, and if i type in "BLUE" the text should be in the colour blue.

I want this to be done with RED, ORANGE, YELLOW, BLUE, GREEN and BLACK.

How can i do it.
Apr 9 '08 #1
2 2988
Delerna
1,134 Expert 1GB
take a look at vbRed in access help

In the Change event for the textbox is where you will put the code
You will change the forecolor property

something like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Text2_Change()
  2.    Select Case Text2
  3.       Case "Red": Text2.ForeColor = vbRed
  4.       Case "Black": Text2.ForeColor = vbBlack
  5.    End Select
  6. End Sub
  7.  
Apr 9 '08 #2
Stewart Ross
2,545 Expert Mod 2GB
Hi Joseph. I have changed the title of your thread from "To" to the title you now see above. It helps all our users if a thread is given a meaningful title, and I am sure you will understand that "To" was not suitable. I am sure this was just a mistake on your part.

MODERATOR
Apr 9 '08 #3

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

Similar topics

2
by: Jeroen van vliet | last post by:
Hello How can i run a query from a mdb database and show it in a datagrid control when i put in a letter in a textbox? for instance. when i type the letter "A" in the textbox i want to run a...
3
by: Astra | last post by:
Hi All Could somebody confirm if and how I can change the TYPE of a textbox from PASSWORD to TEXT depending on whether a user checks a checkbox. In essence I have a login and password form and...
2
by: Mark | last post by:
I am attempting to populate several textbox controls from VBA code. With each attempt, I get the following error: "The macro or function set to the BeforeUpdate or ValidationRule property for...
2
by: mjpiedade | last post by:
I just started with C#. How do I navigate on a dataset by changing the value of a textbox or other simple bound controls? Imagine that I have the customer name on a textbox and have a datagrid...
0
by: marcelo | last post by:
Could you help me out here. I need to accomplish this: I need to filter listbox items from by entering some characters to the textbox. But the problem is that items (files that are read from...
2
by: Mike | last post by:
I am trying to write a little program for my own use using VB2005 express edition. I have a list of peoples names in a file that I read into an array of strings. I am using a multiline textbox to...
4
by: weg22 | last post by:
Hi all, I'm developing a Visual Basic 2005 application to communicate with an I2C device. I recently decided to add an i2c status bar. The status bar is just a textbox with the following...
5
by: kjkrudh | last post by:
How do I convert text (String) from a textbox to a float. I have a user textbox that is entering a number. It is entering as a String. Need it to be a float.
4
by: John Kotuby | last post by:
Hi all, I have a simple user-form which accepts contact and profile information for the user to edit and save. All the textboxes are working fine and displaying the expected data, both when the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.