473,386 Members | 1,801 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.

changing the forecolor of the textfield

140 100+
hi all,

i have a text field called STATUS. if i enter "completed" in that textbox it should become green color else red.

can u tell, how to change a forecolor of my text field. How to code for this ya.
Nov 4 '06 #1
9 8849
PEB
1,418 Expert 1GB
Hi,

To understand the the values for red green and other colors go and change the color of a field manually...

Than save somewhere the value that you want to set automaticlly

On the current form property choose Event procedure and

Type

If me![Status]="Completed" then
me![Status].backcolor=4566565 'value that you've tested
me![Status].forecolor=4566565 'value that you've tested

ELSE
me![Status].backcolor=4566565 'value that you've tested
me![Status].forecolor=4566565 'value that you've tested

end if

See the name of the properties that you've tested I think it should be fore and back color but not sure...
Nov 4 '06 #2
indhu
140 100+
hi its

Actually working but didn't met the criteria. see if status= "completed" it should be green in color else red in color. what happen here is while loading the form both "completed" and "inprogress" appears green in color when I click the colum then turns to red color. this way I don't want.

if status completed "green". else "inprogress = "red"

pls help me
Nov 6 '06 #3
indhu
140 100+
hi,

i have a list box in my form, when i click listbox field it should display corresponding value to other textbox fields.

like
listbox,[ task, status, start date, end date] these are the corresponding text flds
person by clicking this it should display other field values
Nov 6 '06 #4
missinglinq
3,532 Expert 2GB
If you're using Access 2000 or later, the simplest thing to do iss use Conditional Formatting!

In Design View select the control, goto Format > Contional Formatting then set your conditions. You can choose the colors you wish for each condition from a pallette.
Nov 6 '06 #5
NeoPa
32,556 Expert Mod 16PB
If you re-read PEB's post and follow the instructions there, it tells you how to set it to the values you want.
You DO have to find them first.
Nov 6 '06 #6
NeoPa
32,556 Expert Mod 16PB
If you're using Access 2000 or later, the simplest thing to do iss use Conditional Formatting!

In Design View select the control, goto Format > Contional Formatting then set your conditions. You can choose the colors you wish for each condition from a pallette.
This looks like a better solution though. I didn't realise this facility was available in Access!
Nov 6 '06 #7
indhu
140 100+
If you're using Access 2000 or later, the simplest thing to do iss use Conditional Formatting!

In Design View select the control, goto Format > Contional Formatting then set your conditions. You can choose the colors you wish for each condition from a pallette.
hi
thank u so much ya

its working.

do u ve any idea by changing in coding part.
Nov 7 '06 #8
indhu
140 100+
This looks like a better solution though. I didn't realise this facility was available in Access!

its working.. i ve followed PEBs coding but problem in that is its showing green color when i click the status it turns to red. not differentiated the completed and inprogress

thank u for the effort u all took yeah.
Nov 7 '06 #9
indhu
140 100+
Hi,

To understand the the values for red green and other colors go and change the color of a field manually...

Than save somewhere the value that you want to set automaticlly

On the current form property choose Event procedure and

Type

If me![Status]="Completed" then
me![Status].backcolor=4566565 'value that you've tested
me![Status].forecolor=4566565 'value that you've tested

ELSE
me![Status].backcolor=4566565 'value that you've tested
me![Status].forecolor=4566565 'value that you've tested

end if

See the name of the properties that you've tested I think it should be fore and back color but not sure...

hi

thanks yeah

its working, i ve removed ME prefix and just gave status. its working fine
Nov 7 '06 #10

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

Similar topics

3
by: Sidney Linkers | last post by:
Hi, I'm trying to make a calculated text field in a query where the textvalue is being populated from multiple records. I already use a VBA function to loop through records and concatenate the...
3
by: jeffgeorge | last post by:
Working on a report oriented application. One of the columns on a form needs to be red, black or blue depending of the value in that column. Can I write an expression to handle this or does...
0
by: bill mahoney | last post by:
I have access 2k and I have 2 tables. One is a 7X6 table representing a month with zeroes padding the fields where no day exist. For example February 2003 0 0 0 0 0 0 1 2 3 4 5 6 7 ...
3
by: Mariame | last post by:
Hello All i have a label that i change his color Programmatically so i use the following statment : Label88.ForeColor = System.Drawing.Color.Red but the problem that the color isnt known its...
2
by: Mike P | last post by:
Is it possible to change the forecolor of a Span programmatically? Cheers, Mike *** Sent via Developersdex http://www.developersdex.com ***
2
by: shal | last post by:
hello I am trying to change text color of the textbox1 from another form named Form2. i am using following code right now but it doesnt change property of textbox1. can you tell me whats wrong...
3
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
11
by: Hugh Janus | last post by:
OK, this is driving me crazy! As far as I can tell it should work. It compiles fine. I am saving the fore and back colour of a RTB to the registry like this: Srx.SetValue("ForeColour",...
0
by: pargat.singh | last post by:
Hi Everyone: I have a gridview control with AllowSorting="True" and work ok. But my page will be used by different user from different region so i need to change the HeaderText based on language...
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: 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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.