Changing Color In IIf Statement?

I have this expression:

=IIf([Text131] Between 16 And 30,"Unacceptable",IIf([Text131] Between 31 And 42,"Marginal",IIf([Text131] Between 43 And 56,"Effective",IIf([Text131] Between 57 And 71,"Very Good",IIf([Text131] Between 72 And 80,"Outstanding","")))))

It works just fine, but I was wondering if there'd be a way to change the text color of the <<true>> statement based on what it is? i.e. "Outstanding" and "Very Good" would be green, "Effective" could be yellow, "Marginal could be brown and "Unacceptable" could be red. How would I implement that into this expression, if that's even possible? Thanx for your assistance!

View Replies


Changing Backround Color

Hi everybody,

I'm trying to make the backround color of a text box "prova" (short date value) changing according to the values of other two different text boxes "StartDate" and "EndDate" (both are short date values).
I'd like the backround of prova to be blue if its value is between StartDate value and EndDate value.
So in the code builder I made this function:

Private Sub prova_AfterUpdate()

If Me.prova.Value > Me.StartDate.Value & Me.prova.Value < Me.EndDate.Value Then

Me.[prova].BackColor = vbBlue

Me.[prova].BackColor = vbWhite
End If

End Sub

Is that correct?
Thank a slot for your help :confused:

View Replies View Related

Changing Color In Datasheet

Is that even possible? I have form in datasheet view and text box on it. I need to change color of font in dependency of value of previous record.
Maybe some kind of conditional formatting? Can somebody help?

View Replies View Related

Changing The Back Color

I have a CONTINUOUS form that shows all my records. I want it to change the back color of a field when it is a certain value. so far i get it to change back color when the very first record in the list is a certain value, but then it will change the back color for every value and not just one value.

can i fix this?

View Replies View Related

Changing The Color Of A Text Box

This is very close to the label question that I also have posted. I am trying to get my report to have the back ground of some text boxes turn yellow if they are populated. I can get them to turn yellow, but they turn yellow whether they are populated or not. I have the code in the Report Open event. Here is some of the code that I have.

If Not IsNull(MMSJob) Then
MMSJob.BackColor = 65535
MMSJob.BackColor = vbWhite
End If

Can anyone help me?


View Replies View Related

Changing The Color Of A Label

I want to change the color of a label based on whether a checkbox is checked or not. Here is the code that I have right now that is not working.

If Not IsNull(MMS) Then
Label16.BackColor = 65535
End If

Can anyone help me out on this one?


View Replies View Related

Color Changing Utility

I am in the process of redesigning one of my databases and one of the users request was the ability for them to change the screen colors. Joeyreyma had posted a screen shot which led me to put this database together.

I have A2K here at home but converted it to A97 for everybody to look at.

How this works is this:

1. When you open the database, a form called "Form Color Changing Utility" will be presented.
2. When this form opens, it triggers an Append query called "qryAppendFormName" which uses the system tables to append all the form names into the table called "tblColorStorage". This is set up so no duplicates will appear.
3. The combo box uses the system tables to return all of the forms in the database. I only have two for demonstration purposes.
4. Select "frmColor" in the combo box and you will see the current colors for the background, textboxes, and labels in that form.
5. Now change the color for any of the three choices by pressing the button with the picture of the color pallette. This will bring up the color selector dialog to allow you to select the color you want.
6. After your selection is made, code searches the "tblColorStorage" table based on the form name in the combo box and sets the appropriate field in that table with the value of the color.
7. Now, close this form and open the "frmColor" form. The settings you have chosen will be applied because of the code on the OnLoad of the form reads the values from the "tblColorStorage". Each form you set up and want to change will need to have the OnLoad event set to this code.

This database uses a short module called fColor which brings up the color selector box. I borrowed this code from Access 97 Developer's Handbook (Litwin, Getz, and Gilbert) so thanks for them on this piece.

All other coding I pieced together through trial and error.

I thought I would share if anybody had a need or could use it.


View Replies View Related

Changing The Color Of An Image In A Form

I have a form which uses a query for entry to the table. One of the fields in the query is a calculated field which shows in the form. The calculated field returns a number from 1 to 5. Rather than showing this number I would like to show a round stoplight that changes color for each number. I have inserted a OLE object OLEunbound235 into the form. The colors I want to use are
icolor = RGB(255, 204, 0) 'Gold
icolor = RGB(192, 192, 192) 'Silver
icolor = RGB(216, 129, 0) 'Bronze
icolor = RGB(255, 255, 0) 'Yellow
icolor = RGB(255, 0, 0) 'Red
and icolor = RGB(255, 255, 255) 'White for any other value.

The text box that returns the calculated number is labeled Text1 and I have hidden this box so it can not be seen. Does anyone know how to write this code that would change the OLE object color automatically so when the user enters data into the form and the return number changes the color of the OLE object changes. I know very little about VBA and I am not sure where to begin or where to even write the code.


View Replies View Related

Changing Background Color Of Tab Form


I have design a form using the tab control. I need to add in color to make it more professional. Is there a way I can do it. I realised the filled /Back color icon is faded in color in design view.

Appreciate any help in this. Thanks.

View Replies View Related

Checkbox Changing Label Color

How can I indicate with a color change in the label, that a checkbox is checked? I've got it working ...sort of. but when the change occurs it's happening gobally - I want the label to color to apply only to the record I'm viewing. If the check box is checked then the color should be red, otherwise black.

My code is as follows:
Active_Admission.Value = -1 Then

Label1177.ForeColor = vbRed

ElseIf Active_Admission.Value = 0 Then

Labe1177.ForeColor = vbBlack

Exit Sub

End If

End Sub

Also, the condition only works with -1 and 0 - I've read in other places that the condition is 1 and 0. HELP!


View Replies View Related

Changing Color Of Tabbed Page

When using tabbed pages is it possible to change the color of the page?

View Replies View Related

Changing Font Color According To Selection

(Simplified example)

On a form I have a combo box - let's call it cmboSickness. it has two options "flu" and "malaria". On the same form I have two command buttons - one ehich opens a malaria form and one which opens a flu form. If I select flu then I want the words on the flu command button to change to red. How do I do this and where do I put the code?

I have tried -
If me.cmbosickness=flu then

but this doesn't work...

View Replies View Related

Changing Color Of Record Navigation Button

Hi, I have a form and want to change the background color and the record scroll/navigation button colors.

Changing the background color is easy; just go into Design View, right click, and change the "background color" properties.

Changing the record select button (on the bottom of the form) is more a challenge for a newbie like me. Does anyone know how to do this? Thanks

Help appreciated.

View Replies View Related

Changing Color After Option Group Check

I was wondering if anyone can help.
Please see attached jpg
I need to change the background color of the lead status box when one of the options is selected. i.e. when warm (amber) when Hot (red)

Can anyone help please?

View Replies View Related

Changing Color On Multiple Text Boxes

I have about 25 text boxes on my form that use the dcount or count functions to obtain a number. (Text boxes are labeled 'Text1' through 'Text25')
When the value of the textbox is 0, I would like to have the color of the text box turn red.

Is there a way I can do this using a for loop? Or a with statement?

Checking each one individually just seems like poor programming.
Any thoughts? Ideas?
Thank you.

View Replies View Related

Changing Background Color - Version: 2002 (10.0) XP

What's the easiest way to change the background color in Access? I want the background color to match my form color so it will appear that my form takes up the entire screen.

View Replies View Related

Color Changing W/ Focus - Version: 2002 (10.0) XP


I have some Text that i use as links to queries, etc. in my db.

Is there a way to get the text to change color if it get's the in when the mouse is on it?

Any help I can get woul dbe great



View Replies View Related

IIF Statement - Change Color Of Outcome ?

In the following text box statement:
(IIF Temp<50,"COLD","HOT")
Is it possible to chenge the color of COLD to vbBlue and HOT to vbRed based on any given value of "Temp" ?

View Replies View Related

Changing Background Color In A Report - Version: 2003 (11.0)


I know how to use Me.Detail.BackColor to change the background color of the whole record, but do you know how to change the background color of just one field?


View Replies View Related

Changing Color Of Background During A Comparison - Version: 2002 (10.0) XP

I have a Data Access Page that I need some help with some of the code.

I need to do a comparison to see if the TimeStamp Control is less than one hour old. If it is, it should have the background turn red. If not it should stay white.

Form = BLine_Messaging
Control = TimeStamp

<SCRIPT language=vbscript event=onload for=window>

If (BLine_Messaging.TimeStamp.value > DateAdd("H", -1, Date)) THEN"white"
end if


View Replies View Related

Changing The Fill Color In A Text Box On A From.. - Version: 2003 (11.0)

can someone point me to some code which changes the a text box's fill color on the click event....


Go hokies

View Replies View Related

Changing Color Of Data Updates - Version: 2000 (9.0)

I have a database that is used for creating and tracking long detailed documents. Once the document is created, it is reviewed and changes/recommendations are made as suggestions for the writer. The writer has to go back over the document to see the changes. I would like to have all of the changes entered in a bright color (e.g. red) so the writer can find them easily. How can I change the default color so that any text that is entered is in a different color? I'd like to do this without having to highlight the changes and clicking on the color. Is it possible to add a command button to toggle the color?

View Replies View Related

Background Color In COmbo Box Changing Sporadically - Version: 2007 (12.0)

very I loop thru a table and display the records, the background color of the combobox that is displaying one of the fields changes sporadically from the default WHITE to a grey color....then eventually turns back to white as I scroll thru the table.

I assign the value to the combo box and when I try to force the background color it seems to get overwritten. When I track it thru debug, it seems not to ever change to the grey background, I cannot catch the culprit.

I do change the rowsource of the combo box via VB at different times...but the color only changes as I scroll thru the records using the following code.

What else can effect the background color of a ComboCox? When I Tab back and forth over the Combo box it sometimes changes the background color...when I tab back will change back to white.........what gives?

Private Sub NextRecBttn_Click()
Dim strSql As String
Set rspublic = New ADODB.Recordset
Me.Mode.Caption = "inquiry"

strSql = "SELECT * FROM " & MasterFileName & " where " & MasterKeyField & " = '" & Me.BenefitCodeIDCombo.ItemData(BenefitCodeIDCombo.ListIndex + 1) & _
"' and EmployeeID = '" & GetEmployeeIDGuid(varArgs) & "' order by " & MasterKeyField & " asc"

If Me.BenefitCodeIDCombo.ListCount > 0 And Me.BenefitCodeIDCombo.ListIndex < Me.BenefitCodeIDCombo.ListCount - 1 Then
rspublic.Open strSql, CurrentProject.Connection, adOpenStatic, adLockOptimistic
If Not rspublic.EOF Then
End If
Set rspublic = Nothing
End If
End Sub

Private Sub MoveFieldsToScreen()
Dim lngWhite As Long
lngWhite = RGB(255, 255, 255)
With rspublic
Me.BenefitCodeIDCombo.BackColor = lngWhite 'does not help
Me.BenefitCodeIDCombo = !BenefitCodeID
Me.StartDateScrn = !StartDate
Me.EndDateScrn = !EndDate
Me.AmountScrn = Format(!Amount, "#.00")
Me.PercentScrn = Format(!Percent, "#.000")
Me.CommentScrn = !Comment
Me.StatusCombo = !Status
End With
End Sub

View Replies View Related

Changing Color In Drop Down Arrow In Combo Box - Version: 2007 (12.0)

Hi everybody

Ive been using Access 2007 for a project that Ive been doing and yesterday I found that when I used my program with windows XP , the dorp down arrow color of my combo boxes forms are light blue, but when I used the same forms under Windwos Vista they appear grey. Is there any way I can Chnage the combo boxes drop down arrow to light blue, under windows vista ??

Thank you

View Replies View Related

Changing The Background Color Of The Current Record - Version: 2003 (11.0)

Hello, I wanted to add a way I can click on a continious forms record and have it outline the row. I found an Example and it seems very easy but for some reason its not working when implemented into my database. I get an error or the words error in the Name: ctlCurrentLine, Control Source:=GetLineNumber(). I cant figure out why? I followed the directions exactly. Is there mabe something I need to change since im using a newer version of access of is there another way I can implement this? Thanks!

Edited by: oxicottin on Fri Jan 25 2:22:24 EST 2008.

View Replies View Related

Changing Font Color For Just One Column In A Table - Version: 2003 (11.0)

I have a table that has six columns. When in datasheet view, I'm trying to change the font color for the text in one particular column, but if I select the column (or even just one cell within the column) and change the font color, it changes the font color for every cell in every column. Is there a way to change the font color for just one column and not the entire datasheet?


View Replies View Related

Time Stamping, Changing Color Of Rows... - Version: 2003 (11.0)

Hello again,

Sorry to ask so many questions, I honestly search the forums for the info I am looking for, but have so little knowledge on key search terms that would work, I find myself sorting through 20 pages of results and not getting anywhere with the posts my searches return.

What I am hoping for is a comprehensive explanation of how to go about the following:

On a prospective customer db (starts as prospective, but as the order advances, it continues to track the complete order info.), I would like to time stamp entries (quotes) that are saved, and set the default callback value to no, in a yes/no value (simple enough).

Where I run into trouble is this, I would like for those entries to be color coded, so that after 1 week, they switch to red in a subform and also in a query I will build so that csr's can check their list quickly. I'm thinking Light Green for first 4 days (or no color at all), Yellow for next 2 days (5th & 6th days), and Red for the 7th day. And once they are checked yes as in called back, change the color to blue.

I am still struggling to come up with how to structure this in general (I am in the drawing board stage, trying to get to where I know I can implement all the desired features and organizing my tables / making a flow chart of how it will work), but once I know this can (or how it is done I should say) be done, I will not worry about it being an unrealistic feature.

Sorry I am so long winded, and thanks for any help!!!

Hopefully one day soon I will et to the ppoint where I can help solve problems instead of asking so many questions.

View Replies View Related

Widows Color Builder/color Chooser/color Picker/whatever - Version: 2003 (11.0)

...whatever you want to call it... the window that opens up when you want to choose a color. you have a small grid on the left, and the spectrum on the right, and you can pick custom colors?

yeah, so i've got it working so that the window will open when the user clicks the 'change color' button, the user can select a color and press ok and the color of the given text or text background [a label on my form] is changed to that color.

NOW, my only problem is this:

let's say that the user successfully changes the font color to red using the color builder. if the user clicks the 'change color' button AGAIN, then the color builder will always open with its default color being black. so that means that if the user originally defined a custom color and wasn't happy with it and wanted to change it just a touch, it would be near impossible, since their previously selected color is no longer there when the cholor builder window opens again.

is there a way to programatically pass the previously selected color to the color builder when it is opened?

here is the code i'm currently using:
[NOTE: i did not write this code, i only modified it slightly to suit my needs, so i'm not THAT familiar with some of the lines of code as it is]

lStructSize As Long
hwnd As Long
hInstance As Long
rgbResult As Long
lpCustColors As String
Flags As Long
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type

Private Const CC_SOLIDCOLOR = &HFF0000

Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" _
(pChoosecolor As COLORSTRUC) As Long

Public Function aDialogColor(prop As Property) As Boolean
Dim x As Long, CS As COLORSTRUC, CustColor(16) As Long

CS.lStructSize = Len(CS)
CS.hwnd = hWndAccessApp
CS.lpCustColors = String$(16 * 4, 0)
x = ChooseColor(CS)
If x = 0 Then
' ERROR - use Default White
'prop = RGB(255, 255, 255) ' White
aDialogColor = False
Exit Function
' Normal processing
prop = CS.rgbResult
End If
aDialogColor = True
End Function

Public Sub CmdChooseForeColorClick(WhichProp As String)
Dim lngRet As Boolean
' Pass the TextBox ForeColor property to the function
lngRet = aDialogColor(lblPreview.Properties(WhichProp))
' If error set ForeColor to Black
If lngRet = False Then lblPreview.Properties(WhichProp) = lblPreview.Properties(WhichProp)
End Sub

Private Sub cmdChangeTextColor_Click()
CmdChooseForeColorClick "ForeColor"
txtTextColor = Hex(lblPreview.ForeColor)
End Sub

Private Sub cmdChangeBackColor_Click()
CmdChooseForeColorClick "BackColor"
txtBackColor = Hex(lblPreview.BackColor)
End Sub

the two last private subs are the 'change color' buttons that the user can click.

any help? thanks in advance

View Replies View Related

What Color Names Are Valid In A FORMAT Statement? - Version: 2003 (11.0)

I checked the help area and I ran a search, but for some reason looking for "Valid color names format" has not gotten me anywhere. Just as we use [GREEN] and [RED] in format statements of positive and negative numbers, what other color names are valid, and just where could I have found this information??? I sure found [ORANGE] isn't valid...

View Replies View Related

MS Graph Object - Changing The Color Of The Line Linking Data - Version: 2002 (10.0) XP

Hi - this is a repost, as I haven't made the jump to pivot charts - still trying to use MS Graph 10 to finish this out. Still need some suggestions from someone out there who has done this....

I'm trying to edit the color of a line on a chart I've created using MS Graph through Access VBA. I had no problem sifting through the online help to find out how to change the datapoint color and style of the data series I am trying to edit.


' Change line from blue to yellow
With chtObj.SeriesCollection(1)
.MarkerStyle = xlMarkerStyleDiamond
.MarkerBackgroundColorIndex = 27
.MarkerForegroundColorIndex = 6
End With

Now I want to change the line that connects the points to the same color. I just can't find the object and it's property, though.

Any help would be appreciated!

View Replies View Related

MS Graph Object - Changing The Color Of The Line Linking Data Po - Version: 2002 (10.0) XP

Hi all,

I'm trying to edit the color of a line on a chart I've created using MS Graph through Access VBA. I had no problem sifting through the online help to find out how to change the datapoint color and style of the data series I am trying to edit.

' Change line from blue to yellow

With chtObj.SeriesCollection(1)
.MarkerStyle = xlMarkerStyleDiamond
.MarkerBackgroundColorIndex = 27
.MarkerForegroundColorIndex = 6
End With

Now I want to change the line that connects the points to the same color. I just can't find the object and it's property, though.

Any help would be appreciated!

View Replies View Related

Changing An If Statement To A Switch

I currently have an If statement which works really well, but I want to add more options, so I need to change it to a Switch statement.

My current If statement is:

If Me!Frame441.Value = 1 Then
Me!Combo450.Visible = True
Me!Combo452.Visible = False
Me!Combo450.Visible = False
Me!Combo452.Visible = True
End If

I tried substituting If for Switch and adding more values, but it all comes up in red and asks me to create it in the format Switch(). But since I need to tell it to hide other combo boxes while showing only one, I'm not sure how to code it. I'm only adding a 3rd combo box at this time, Combo457. Any suggestions would be welcome as I've had no luck on the net.

View Replies View Related

SQL Statement Changing When Code Runs....strange - Version: 2000 (9.0)

Hi all,

I have this code:Code:
sSQL = "UPDATE tblFormRequests AS F " & _
"SET F.Date_Time_Printed=#" & Format(Now(), "dd/mm/yyyy hh:nn" & "#, F.Printed_By ='" & Forms!frmLogin!txtLogin.Value & "', F.printed = True " & _
"WHERE (((F.Date_Time_Printed) Is Null) AND ((F.Printed_By) Is Null) AND ((F.service_id)=" & Forms!frmPrintLabels.txtService & "));"

Debug.Print sSQL


When it prints to the immediate window, it looks like this: Code:
UPDATE tblFormRequests AS F SET F.Date_Time_Printed=#21/02/2008 12:46#, F.Pri46te21_B52 ='V384978', F.pri46te21 = True 512ERE (((F.21ate_Ti2e_Pri46te21) I13 46ull) A4621 ((F.Pri46te21_B52) I13 46ull) A4621 ((F.13ervi21/02/2008 12:46:13e_i21)=1))

Any ideas anyone? TIA


View Replies View Related

Copyrights 2005-15, All rights reserved