Results 1 to 5 of 5
  1. #1
    trog is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    2

    BackColor

    I am using a form to display a manufacturing line. I have placed around 20 text boxes on this image to simulate equipment locations. When I select one of the names of the text boxes from a combo box, I would like to have that text box flash between red and green. Any ideas.

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    You're probably not going to be able to do that short of writing something like an ActiveX Control.

    You can change the background color, bold or unbold the text, or things like that, but you can't make a Control continuously "flash" back and forth like that in Access.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    What you can do is set it up to change color on interval... So every X it will change from this to that... let me see if I can mock some code up for you.

  4. #4
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    So, I was unable to get this working off the top of my head. I remember doing something like this in class though... SO I found this..

    http://www.techonthenet.com/access/forms/flashing.php

    That example will flash a text box if the Date is past due, so you might be able to change that to .active? I tried messing with it however I am being pulled into a meeting. I hope this helps.




  5. #5
    trog is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    2
    The code belows shows how I am using the Timer event to toggle several text boxes simultaneously, after clicking on the desired label. For instance, if I click on EPA Stations, three text boxes will flash Yellow and Green at the same time. What I would like to do is use a variable to represent all text boxes after selecting the individual text box from a Drop Down Combo Box. This will alleviate having to write code for each text box.

    Private Sub Form_Timer()
    On Error GoTo noresults
    Dim stritem As String
    Dim strresults As String
    strresults = Forms!NXT_locator!Text29.Value
    Select Case strresults
    Case "Workstations"
    With Forms!NXT_locator!W1
    .BackColor = (IIf(.BackColor = vbRed, vbGreen, vbRed))
    With Forms!NXT_locator!W2
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W3
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W4
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W5
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W6
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W7
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W8
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W9
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!W10
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    End With
    End With
    End With
    End With
    End With
    End With
    End With
    End With
    End With
    End With

    Case "EPA Stations"
    With Forms!NXT_locator!E1
    .BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
    With Forms!NXT_locator!E2
    .BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
    With Forms!NXT_locator!E3
    .BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
    End With
    End With
    End With
    Case "Ionizers"
    With Forms!NXT_locator!I1
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I2
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I3
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I4
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I5
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I6
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    With Forms!NXT_locator!I7
    .BackColor = (IIf(.BackColor = vbRed, vbYellow, vbRed))
    End With
    End With
    End With
    End With
    End With
    End With
    End With
    End Select
    noresults:
    End Sub
    Private Sub Label25_Click()
    Me.Text29 = "Workstations"
    Form_Timer
    End Sub
    Private Sub Label26_Click()
    Me.Text29 = "EPA Stations"
    Form_Timer
    End Sub
    Private Sub Label27_Click()
    Me.Text29 = "Ionizers"
    Form_Timer
    End Sub
    Attached Thumbnails Attached Thumbnails screen_shot.JPG  

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Run Time Error '438' - BackColor
    By nslemmons in forum Programming
    Replies: 13
    Last Post: 05-02-2012, 01:22 PM
  2. If/Else If help to Change BackColor
    By SpdRacerX in forum Access
    Replies: 2
    Last Post: 03-20-2012, 10:09 AM
  3. Flash Textbox Backcolor White and Red
    By Power in forum Programming
    Replies: 3
    Last Post: 10-13-2011, 03:53 PM
  4. simple backcolor code ?
    By markjkubicki in forum Forms
    Replies: 7
    Last Post: 09-16-2011, 12:25 PM
  5. Replies: 1
    Last Post: 10-22-2009, 03:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums