473,714 Members | 4,906 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6485
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.co mwrote:
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 Developersdexht tp://www.developersd ex.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******** *************** ***********@i7g 2000prf.googleg roups.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
4168
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 unrelated subform that are filtered according to the date entered in the form's text box. By using after update events, I've been able to allow users to change the date in the textbox and alter records from the day throughout three other tables. ...
4
20783
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 what I am looking for is a way <behind a button click event> to dynamically change the Subform's color scheme so the listing can have color choices. Is this even possible? Thanks again to anyone who may be able to help Wes
2
4395
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 separate unbound form with all the fields, which are on the subform. The fields are filled in with data programmatically. User edits. Edited fields are copied into fields on the subform programmatically as well. I need to catch change in one of...
25
10252
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
3
3305
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 the field should only be showing one or the other (date or time). Even on the back end of the database where the column properties are, I have chosen the smallest date/time formats. When the aspx page runs, it shows the date and time (ie:in a...
9
9692
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 master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
4
5883
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 name of the month as jan 07 Any ideas?
8
23795
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
16166
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 fill in data in the main form fields and populate the data into the subform fields after the fietsid is typed. Because the data in 2 first to field is most of the time the same data for each record. Only the fietsid is every tim ea new uniek number.
0
8712
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9316
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9077
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6638
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4729
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3160
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.