473,402 Members | 2,072 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,402 software developers and data experts.

Change forecolor of field in subform Access 2007

TD
I am trying to change the forecolor of a field in a subform that is in
datasheet view. I am using Access 2007. I have tried everything I
can think of to do this but the text still appears in black. I need
it to appear in red if the field has the word "YES" in it. Is there
something in Access 2007 that keeps this from working?????

Feb 20 '08 #1
4 6460
Access does not have the capability to change colors of fonts/cells in a
datasheet view -- natively.

One fix that comes to mind would be to create a com User control in
VB2005 using a datagridview control (the .Net equivalent of an Access
subform) which has mega versitility and then implement that in Access.
The only caveat here would be that whoever used the control would need
to be running the .Net 2.0 framework on the respective workstation(s)

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Feb 20 '08 #2
TD
On Feb 20, 2:56*pm, Rich P <rpng...@aol.comwrote:
Access does not have the capability to change colors of fonts/cells in a
datasheet view -- natively. *

One fix that comes to mind would be to create a com User control in
VB2005 using a datagridview control (the .Net equivalent of an Access
subform) which has mega versitility and then implement that in Access.
The only caveat here would be that whoever used the control would need
to be running the .Net 2.0 framework on the respective workstation(s)

Rich

*** Sent via Developersdexhttp://www.developersdex.com***
Thanks for the help!
Feb 20 '08 #3
On Feb 20, 12:37*pm, TD <d...@adsi-sc.comwrote:
I am trying to change the forecolor of a field in a subform that is in
datasheet view. *I am using Access 2007. *I have tried everything I
can think of to do this but the text still appears in black. *I need
it to appear in red if the field has the word "YES" in it. *Is there
something in Access 2007 that keeps this from working?????
Well, you can try this way on your form
you need to create two unbound textboxes

in the controlsource of the first one
=IIf([yourYesNofield]="yes",[yourYesNofield],"")
define the forecolor of this one as red(or whatever color you want)

in the controlsource of the second one
=IIf([yourYesNofield]="no",[yourYesNofield],"")
define the forecolor of this one as black(or whatever color you want)

be sure you have the real [yourYesNofield] field in place but set its
visible property to false.

make sure all three boxes are the same size and layer them on top of
each other

change the form property from datasheet to continuous form

hope this helps
bobh.
Feb 20 '08 #4
Simply use Conditional Formatting. Look it up in Access Help.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"TD" <dl**@adsi-sc.comwrote in message
news:d3**********************************@i7g2000p rf.googlegroups.com...
>I am trying to change the forecolor of a field in a subform that is in
datasheet view. I am using Access 2007. I have tried everything I
can think of to do this but the text still appears in black. I need
it to appear in red if the field has the word "YES" in it. Is there
something in Access 2007 that keeps this from working?????

Feb 21 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sam Gledhill | last post by:
Hi, I'm hoping someone can help me out. I have a database with a form. This form has no recordsource (I'm using it as a complex MsgBox). It has a single textbox of type Date. It also has three...
4
by: codemonkey | last post by:
TIA! I would like to know if there is a way to dynamically change the colors of Subform items? I have already set in place Conditional Formatting so each row has an alernating color scheme, but...
2
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
4
by: Henrootje | last post by:
I have a REPORT with in it a subFORM Now I have this label (lblMonth) that I want to change. How should I do this? What would be the proper event to do this? The lblMonth should contain the...
8
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Form is: Forms!FormName..RowSource = "TableOrQueryName"
7
by: heinemans | last post by:
Hi there, main form name = reserveringen subform name = subform reserveringen main form fields are: datetot, datevan, fietscode. Subform fields are: dateuit, datemin, fietsid Now i want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.