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

Is it possible to change the color of a form view depending on value?

294 256MB
I've a formview that displays the results of a query based on the criteria typed into a textbox. It works magically. I would like to, however, change the color of the formview to red or green based on the values inside the form view.

For example:

Rating: 4.0
Course Number: MGMT 2080


Those are inside the form view. I essentially want,

If rating >= 3.5 Then
FormView.Color = Green
End If

Is this possible?
Dec 4 '13 #1

✓ answered by Falkeli

Expand|Select|Wrap|Line Numbers
  1. if (rating>=3.5)
  2.     form.BackColor = System.Drawing.Color.Red;
If the condition is in a method of the form, replace the word "form" with "this"; if it's elsewhere, use a variable refering to the form.

1 1196
Falkeli
19
Expand|Select|Wrap|Line Numbers
  1. if (rating>=3.5)
  2.     form.BackColor = System.Drawing.Color.Red;
If the condition is in a method of the form, replace the word "form" with "this"; if it's elsewhere, use a variable refering to the form.
Dec 30 '13 #2

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

Similar topics

2
by: Simon Pleasants | last post by:
Am something of a newbie at this, so please bear with any stupid questions. I have created a database to track shipments that we import. The information is stored in a table and I have created...
9
by: David White | last post by:
Hello everyone, I'm new to access, so if this is a dumb question I apologize in advance. I created a query that requires a "parameter value" to be entered. I then created a form to display...
10
jamjar
by: jamjar | last post by:
How do I change the form view using VB after the form is opened? I am using the Switchboard pretty much as the wizard loads it. I've tweaked the appearance and a couple of lines of code but I...
8
by: ontherun | last post by:
Hi All, I want to include some code for the OnTimer event in my Form "frmDueDateList" But when i open the form in the design view and checked the properties menu, i could not find the OnTimer...
2
by: billypit | last post by:
Hi, I have one form in which I have one combobox and one subform. now when I am selecting value from combobox it will show details in subform by filtering from table based on my selection of...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
1
by: lupusdark | last post by:
Hi, I have a form which opens another form. when a record is changed on the first form information changes on the second form. The first forms view is on 'single form' but i want the second...
1
by: de_ja | last post by:
HI, Thanks for assisting me with my previous query. I have almost completed my access database. And now in the process of optimising it. When I first developped the database I had...
4
by: RLN | last post by:
re: Access 2003 I have a field called SentByMethod the displays a 'zero', '1' or '2'. I am trying to set up a text field that shows "Sent by X" if it's 0, "Sent by Y" if it's 1, and "Sent by Z"...
0
by: ayethwe | last post by:
hello everybody, i m a new one for VB6.0 i'd never used of it. now i face with a problem. i made a text box from form view. now., i want to change the size of the text box. not changing this...
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:
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...
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
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...
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
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...
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,...

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.