Results 1 to 4 of 4
  1. #1
    Power is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    2

    Flash Textbox Backcolor White and Red

    Hi, 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.


    Thanks in advance!

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Power View Post
    Hi, 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.


    Thanks in advance!
    set the form timer to 1000. This equals one second interval. If you want to have it flash faster, reduce the number until desired interval. Put the is the "On Timer" event of the form

    If Me.YourFieldNae.BackColor = 255 Then
    Me.YourFieldNae.BackColor = 16777215
    Else
    Me.YourFieldNae.BackColor = 255
    End If

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    That code will initiate the flashing as soon as form opens. Is that what you want?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Ok, the code was to provide example on how to get the flashing going. You must add additional conditions before the code in order to get the flashing going when you need it

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

Similar Threads

  1. simple backcolor code ?
    By markjkubicki in forum Forms
    Replies: 7
    Last Post: 09-16-2011, 12:25 PM
  2. Flash green or red
    By elmister in forum Access
    Replies: 8
    Last Post: 08-30-2011, 03:37 PM
  3. Why The White Box?
    By orcinus in forum Access
    Replies: 3
    Last Post: 08-05-2011, 01:55 PM
  4. Replies: 1
    Last Post: 10-22-2009, 03:32 AM
  5. Printing Flash Cards
    By EricMK in forum Reports
    Replies: 1
    Last Post: 07-08-2009, 12:24 PM

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