By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Conditional Formatting Access 2003

P: 9
Hi All,

I have a couple Date fields in a form that are usually Null but when they are not I would like the field to be highlighted, bold and flash. I usually right click on the field and go to Conditional Formatting, there I know you can set the conditions but I do not know how to make the field flash (hopefully that is the right term). If there is any reference someone can give me that would be great. If this cannot be done please let me know as well. Thank you for any input.
Dec 16 '07 #1
Share this Question
Share on Google+
3 Replies


puppydogbuddy
Expert 100+
P: 1,923
Hi All,

I have a couple Date fields in a form that are usually Null but when they are not I would like the field to be highlighted, bold and flash. I usually right click on the field and go to Conditional Formatting, there I know you can set the conditions but I do not know how to make the field flash (hopefully that is the right term). If there is any reference someone can give me that would be great. If this cannot be done please let me know as well. Thank you for any input.
See this link for a step by step:
http://www.databasedev.co.uk/control_flash.html
Dec 16 '07 #2

ADezii
Expert 5K+
P: 8,616
Hi All,

I have a couple Date fields in a form that are usually Null but when they are not I would like the field to be highlighted, bold and flash. I usually right click on the field and go to Conditional Formatting, there I know you can set the conditions but I do not know how to make the field flash (hopefully that is the right term). If there is any reference someone can give me that would be great. If this cannot be done please let me know as well. Thank you for any input.
  1. I'll provide the code for the 1st Date Field which I named txtDateField1, just incorporate similar code for the 2nd Field.
  2. Set the Form's Timer Interval to 1000 (1 second), adjust to your liking.
  3. The following code will poll the Status of txtDateFiel1 every second to see if it is Null or not. If it is Not Null, the Font will be Bold and a pseudo flashing will occur.
  4. Place the following code in the Form's Timer() Event.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Timer()
    2. Static lngCounter As Long, fld1 As TextBox
    3.  
    4. Set fld1 = Me![txtDateField1]
    5.  
    6. lngCounter = lngCounter + 1
    7.  
    8. If IsNull(fld1) Then
    9.   fld1.FontBold = False
    10.   fld1.BackColor = QBColor(15)
    11. Else
    12.   fld1.FontBold = True
    13.     If lngCounter Mod 2 = 0 Then    'produces the Flash Effect
    14.       fld1.BackColor = QBColor(15)
    15.     Else
    16.       fld1.BackColor = 10092543   'Light Yellow
    17.     End If
    18. End If
    19. End Sub
Dec 16 '07 #3

P: 9
Thanks puppydogbuddy and ADezii for the reference and the code, I was able to understand it. I got all the fields working, I really appreciate all the help.
Dec 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.