I have several forms that each has a dozen or more checkboxes, true/false. I want to be able to change the background color of the label of each checkbox depending on if the checkbox is true or false. I have used the following code which works great:
If Me.A = True Then Me.lblA.BackColor = vbYellow Me.lblA.BackStyle = 1 Me.lblA.ForeColor = vbRed Else Me.lblA.BackColor = vbWhite Me.lblA.ForeColor = vbBlack End If
Me.A refers to T/F checkbox A and Me.lblA refers to its label. This is repeated for each of the checkbox controls. If the control is [B], then its label is lblB. I have used this in the form OnCurrent event and the checkbox control OnUpdate event. I was wondering if I could use the tag property to this, saving me writing countless lines of code and having the OnCurrent event of each of the forms so long and cumbersome. And I do know that I can use conditional formatting to do this, but I would prefer not to use that method. Is there any way to do this using the tag property and not so many lines of code?
Please can someone tell me how to change the back colour of a control when it has the focus and then revert to the original colour when it loses it. I have 35 controls on my form, so I need a function, rather than changing the colour with a subroutine evey time.
I have searched the site and haven't found whatI want-though I'm sure this question has been asked before.
How do I conditionally change the Back Color and Alternate Back Color based on the value of notes.FollowUpDate? I have a continuous form using the following code:
Code: Private Sub b_all_past_Click() Me.resultsFrame.SourceObject = "FollowUp_bystaff" Me.resultsFrame.Form.RecordSource = "SELECT * From notes WHERE (((Notes.FollowUpDate) < Date()+1) And ((Notes.followup_person_id) = GetCurrentUserId()))ORDER BY notes.priority,(notes.FollowUpDate) DESC;" ' End Sub
I know you can use a "Conditional format" to change a color of a control in a report. What I am trying to do is change the whole line if a condition yields "True" of one control. I did it once before, but oops I didn't save my work. I am using the format [Entity]![IT]. Where "Entity" is either the department or vendor, and "IT" is for the IT department. I want the control "Name" to change color if "Entity" is true if "IT" is the data.
I'm using the changebackgroundcolor.zip sample that I found here at Lebans site. URL....I'm trying to find a way to keep the color that I picked after the database closes. I tried to follow the example here URL....but couldn't get it to work.how to get the color to stay on the color that was picked from the dialog box?
I am trying to change the button color on a subform if a related form data changes.Main form is products with a continuous subform with serial numbers of products i.e, serial number, location, price and a button to add addtional issues if there are any for this particular serial number (this will open up another form related to the serial number so I can add an issues if there are any).The reason I would like the button to be a different color is so I can quickly see if there are any additional notes been added to the serial number. Just in case you may ask why not add the field to the continuos form is that the issues and be quite lengthy and there may be lots of serial numbers on the form
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_Active_Admission_click: 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!
I'm trying to add some life to my form by using some different colors, but I can't figure out how to change the color of a button. Does anyone know how to do this? Thanks
On a form how can i get the text to change to red if the number is Greater than 500 and blue if the number is less than 500, the text box is populated via a query
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
Code:<SCRIPT language=vbscript event=onload or=window><!--If (BLine_Messaging.TimeStamp.value > DateAdd("H", -1, Date)) THEN BLine_Messaging.style.backgroundColor="white"else BLine_Messaging.style.backgroundColor="red"end if --></SCRIPT>
I have a similar problem, I'm fairly new to ACCESS and am learning it is vastly different than EXCEL that we use (we are upgrading to ACCESS to track our "in" and "out". I have set up a ACCESS database to track our barge loading and pumping, on the delay we enter reason for the delay but if no delay occurs it is left blank. How can I get the field to change colors if information is entered and left alone if none is entered. Quote: Originally Posted by shamrog12 Make sure to dim recItem1Value and backg in the appropriate area
Try this: Code:<%recItem1Value = lcase(Recordset1.Fields.Item("RecItem1").Value)backg = ""Select Case recItem1Value Case "x" backg = " style=""background-color:red;"" " Case Else backg = ""End Select%><!-- whatever code here... //--><td<%=backg%> nowrap><input name="txtField1" type="text" onChange="RecUpdate value="<%=(Recordset1.Fields.Item("RecItem1").Value)%>" size="4"></td>
I have installed Windows 10 & Office 13.The Background color of MS Access 13 is white in color which is irritating. Is there a way to change the background color?
I've got a little box covering up a drop down arrow on a combo control that resides on a tab control. The problem is that, since the Back Color property isn't available for a tab control, I have no idea what color it is...which is what the color of my box object (rectangle technically) needs to be so as to blend in. It looks a little garrish with it standing out there...
Any ideas what the default color of the tab page background is? Using Access 2003.
I have a form with the standard light grey background. I insert a tab control, and the default back color is white. I set the BackStyle to Transparent, and it still displays as white.
Am I missing something here, I want the back color of the tab control to be the same as my form.
Now, what's really odd, is in this project it creates tab controls as white, but if I open an old project of mine, it creates tab controls with the same light grey back ground of the form.
I believe thats the proper word for it. Attached is a screenshot of a section of the database that I have started working on. It is to track placement for a college. Its my first ever and I am fairly good at making things look good, but as far as function - I am terrible.
I can change the raised box that the tab control sits on to a dark maroon when someone has a felony (so it notifies the user of this status)
Private Sub Form_Current() If [Felony] = True Then Felonybox.BackStyle = 1 Felonybox.BackColor = RGB(159, 19, 44) Else Felonybox.BackStyle = 1 Felonybox.BackColor = RGB(208, 207, 202) End If
End Sub
I also have this done on After_Update.
I am trying to change the font on the Tab Control to Red when this occurs as well (only change the 'Criminal History CONFIDENTIAL' to red). I can not find this option anywhere, is this something that has been done or CAN be done?
How do I change the background color of a tab or can you? The form that I am looking at has a tab button, but it looks like a normal form for the background. It has the grid and has a color for the background. I have designed a new form and added a tab control. But the background is grey and I would like to change it. Please help, if you can. Thanks.
I have a report card program that I use in my classroom. The program calculates letter grades for various sub categories.
For example, under the Primary Category Math, the computer will calculate a letter grade based on assignment scores and place the grade into a combo box for the sub category "Able to use a graphing calculator."
If I override the grade the program calculated for a student, I would like the text in the combo box to change to red for that student only. Then I can go back and quickly see which grades I have manually changed.
I just cannot seem to figure out the logic to use VBA that would check to see if a user has changed individual combo boxes.
What I want is in the combo box, I have a couple of options, say 1,2 and 3. And I want the combo box to come up with different color when different option is selected.
I thought I have found out a way, with the following code to onClick:
If me.field.text = "1" Then me.field.backcolor = 255
The problem is, it's being shown on a continuous form. And it changes the color on all the records. not just the one I am on.
How do you change negative number to red in a report's text box? i am thinking it is an iff statement in the control source field but running into issues.
Is there a way to change all Negative nubmers to red in a Report? That is, do i have to change all text boxes individually?
I have created a MS Access barchart by running a query. X axix has user name and y axis has counts. I would like to change every bar's color based on the x axis user name value .Is there a way to do that using vba code in MS Access barcharts.