473,653 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update a field color based on field contents

Hi guys,

I'm using a subform to display a list of values from a single table.
The form is showing the values in "continuous forms" view and there
will only ever be two different values for the form. The form show 2
fields, 1 is a number and the second is a calculated field that says
either "Valid" or "Invalid" based on the first fields contents. What
I need to do is if the value is Invalid then I'd either like the text
or the actual field to be red so it stands out from the other fields
but if the value is Valid then I want the field to be standard (i.e.
white background, black text.).

Could anyone help me to work this out as it's probably very simple but
I've been pulling my hair out this morning (and there isn't very much
to begin with.).

Many thanks, Dean...
Jun 27 '08 #1
2 1829
On Mon, 16 Jun 2008 12:26:12 -0700 (PDT), DeanL wrote:
Hi guys,

I'm using a subform to display a list of values from a single table.
The form is showing the values in "continuous forms" view and there
will only ever be two different values for the form. The form show 2
fields, 1 is a number and the second is a calculated field that says
either "Valid" or "Invalid" based on the first fields contents. What
I need to do is if the value is Invalid then I'd either like the text
or the actual field to be red so it stands out from the other fields
but if the value is Valid then I want the field to be standard (i.e.
white background, black text.).

Could anyone help me to work this out as it's probably very simple but
I've been pulling my hair out this morning (and there isn't very much
to begin with.).

Many thanks, Dean...
Access 2000 or newer?
You can use the control's Conditional Formatting.

In Form Design View, select the calculated control.
Click on Format + Conditional Formatting.
Set Condition1 to
Field Value Is equal to
write
"Invalid"
in the next box.
Select the appropriate backcolor/forecolor color you wish.
Save the change.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 27 '08 #2
Thanks Fred,

That worked like a charm and does exactly what I need it to.

Much appreciated.

Dean...
Jun 27 '08 #3

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

Similar topics

3
5370
by: Lapchien | last post by:
done homework on Usenet and still stuck... I have a parameter query that asks the user to input the 'slip reference' based on the accounting period. This has now changed slightly so that the slip reference number is based on the date, so for instance if the date is as follows, the slip reference is as follows: J12345 21/08/2003 J12346 22/08/2003 J12347 23/08/2003
6
10449
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo field, and it works. But, it seems wrong since I had to create a huge text box to accommodate memo fields with a lot of text. Thanks for any help, ShyGuy
3
6308
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field new field table 2 has: key field (autonumber)
2
3898
by: John Baker | last post by:
Hi: Hi: I have a form which is based on a query, and is being used to update a table. It all works well, except for one thing. I have a number of unbound calculation fields (total value, Labor Value, etc) which are based on the contents of the records. Within the records themselves there are also calculated fields (Line item value). When I change a critical field (price per unit), and do a Refresh (through a macro linked to the after...
2
6410
by: Nu2ASP.NET | last post by:
What I am trying to do is essentially 'flip' the bits, when the user clicks in the checkbox. For example, if the CheckBox appears checked, and the user un-checks it, I want the underlying data field to change from a "1" to a "0" (and vica versa). I have the bindings worked out, I just can't figure out how to do the update. Here is my source:
2
19589
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the field in table2. What I have is a form that is linked to Table2. If the users want to change a field in the main database (table1), they fill the change in to the form (which is linked to table2) If there is no change to the field, they simply...
4
1853
by: Ruben | last post by:
Hi, I have a continuous form that provides a listing of various instruments that are serviced on a monthly to annual basis, with general info about the instrument, last and next service dates, etc. What I am trying to do is create an On Open event procedure that will identify all instruments that are listed with a string of either "Past Due" or "Schedule Vendor" based on whether each of their respective
2
2899
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same time. Below is a working script that I used. Let's say after the file is uploaded to the server and a record created with the file contents above to the MS Access (using the script below). If I want to UPDATE that record let's say, change the...
7
2402
by: BONES7714 | last post by:
Hello, This is my first post to any sort of forum although I've used them to learn the very little Access/VBA that I know so please forgive my ignorance. I work for the National Guard as Combat Medic and I've been tasked with created a DB to track the location of other soldiers medical records and other various infomation. As such, I have a form where I can enter the barcode for a record into a textbox and have it added to a listbox and...
0
8811
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...
0
8704
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8470
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
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.