Topics Search

Change TextBox BackColor to Transparent

Change TextBox BackColor to Transparent
Views: 170
I've seen a lot of messages asking how to pro grammatically change the color of a TextBox to a color, but not on how to do the reverse. If in my form or in my code, I have the BackClolor set to red, how do I pro grammatically change it to be transparent?
Sponsored Links:

More topics

 

A code to change textbox property in a form?

Preview
how to change a textbox properties in a form, I have seven textboxes named Sat,Sun,Mon. and I wrote the below code to find the current day:
Dim Today As String
Today = Format(Date, "ddd")
What Im looking for is a code to change the textbox BackColor for the textbox that matches the value returned by the above code.
 

Change text box backcolor conditionally

Preview
I have an Access 2010 database to hold employee data and I have a report to flag when a performance review is coming up, overdue or done.

The textbox (Date/Time type) that holds the review date is called [ReviewDate]. I use conditional formatting to turn the backcolor yellow if the date is less than 30 days from now, and that works.

I want the backcolor on the report to be red. If the value of the checkbox [ReviewDone] is yes, indicating the review has been completed, I want the backcolor to be white.

I'm not using conditional formatting for the red backcolor because it seems to take priority and ignore any VBA code about turning white if the box is checked.

So I wrote what should be simple code and put it in the report's Current event property, but absolutely nothing happens.
 

Flash Textbox Backcolor White and Red

Preview
I have searched for code to flash the backcolor of a text box but haven't found what I want. I am sure it is a simple timer but I know just enough to be dangerous.

If a user changes a date in a text box (SubmitDate) on form 1 and tabs out of the field, I have code in the AfterUpdate event to update this date change on a text box on form 2 (that is also open) so they stay in sync. I have some code that changes the backcolor of the text box on form 2 to red, then changes it to white, then red again and then back to white so it appears to flash, but it is very inefficient. Is there a simple way to alternate the backcolor from white to red, to white, to red, then back to white with a 1/2 second interval between each color change? I am using DoEvents so I can continue other processes while it changes color
 

Simple backcolor vba code returns error

Preview
I need a bit of help getting the syntax of a line of code that would change the backcolor on a subform. I have this, but it yields an error

If Me.tglInstallationNoteFlag = False Then
Me.chldInstallationNotes.Detail.BackColor = NormalColor
 

Backcolor of detail section

Preview
How can I change the backcolor of the detail section by group in my report of Access 2003? Now I have different backcolor per row.
 

Flash Textbox Backcolor White and Red

Preview
I have searched for code to flash the backcolor of a text box but haven't found what I want. I am sure it is a simple timer but I know just enough to be dangerous.

If a user changes a date in a text box (SubmitDate) on form 1 and tabs out of the field, I have code in the AfterUpdate event to update this date change on a text box on form 2 (that is also open) so they stay in sync.

I have some code that changes the backcolor of the text box on form 2 to red, then changes it to white, then red again and then back to white so it appears to flash, but it is very inefficient.

Is there a simple way to alternate the backcolor from white to red, to white, to red, then back to white with a 1/2 second interval between each colorchange? I am using DoEvents so I can continue other processes while it changes color.
 

Change Row Background Color Programmatically

Preview
I have a report and I want the backcolor to change based on the value in a field named color. Here is the code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Me.Color
Case Purple
Me.Detail.BackColor = RGB(204, 204, 255)
Case "Green"
Me.Detail.BackColor = RGB(204, 236, 255)
Case Yellow
Me.Detail.BackColor = RGB(255, 255, 204)
Case Blue
Me.Detail.BackColor = RGB(204, 236, 255)
Case Orange
Me.Detail.BackColor = RGB(255, 204, 153)
Case Grey
Me.Detail.BackColor = RGB(221, 221, 221)
Case Else
Me.Detail.BackColor = vbRed
End Select
End Sub

This has no effect. However I was able to change the background color of a box set behind the other fields with this code. The problem was that it set all fields to the value from the last box
 

Creating a mouse hover event

Preview
I am trying to make the textbox change color when mouse is run over the button and then go back to the default color. at the moment it changes color to red when mouse is over, but it does not change back. does anyone know how to do this?

Private Sub Text11_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Me.Text11.BackColor = vbRed

End Sub

Private Sub Form2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Me.Text11.BackColor = vbBlack
 

Access 2010: Setting Report Textbox Backcolor from Field Condition

Preview
I have an Access 2010 Report in which I'd like to be able to set the Textbox Backcolor property based on the condition of another field value within the same record of the Report.

For example:

I've tried the following code in the Report Event Procedures "On Load" and "On Open" but it does not work
 

Setting a Color on a Control For Error

Preview
I have a continuous form. I can add/change/delete. When I add a record I try to set the backcolor to red. However all of the controls for the text box are set to red. I just want to change the backcolor of that one control to red. How can I do that?

Here is the snippet of code. Hexcolor is a subroutine which sets the color to red.

ElseIf IsNull(Me.SchTime) Then
Response = MsgBox("Please enter the time", vbInformation)
Me.SchTime.SetFocus
Me.SchTime.BackColor = HexColor("CC