A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Make Label Flash



 
 
Thread Tools Display Modes
  #1  
Old December 20th, 2006, 08:24 PM posted to microsoft.public.access.forms
CRZ
external usenet poster
 
Posts: 1
Default Make Label Flash

I would like to know how I can make a label on a form flash if a field on
that form has text in it and not flash when the field is null?
  #2  
Old December 20th, 2006, 09:13 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Make Label Flash

You can use the Timer Event of the form.
Set the TimerInterval property to how often you want the label to change.
In the Timer event, test to see if the control is Null. If it is not,
change the label appearance.

"CRZ" wrote:

I would like to know how I can make a label on a form flash if a field on
that form has text in it and not flash when the field is null?

  #3  
Old December 20th, 2006, 09:33 PM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default Make Label Flash

On Wed, 20 Dec 2006 12:24:00 -0800, CRZ
wrote:

I would like to know how I can make a label on a form flash if a field on
that form has text in it and not flash when the field is null?


You'll need to use the Form's Timer event. Set the Form's Timer
property to 500 (milliseconds, two flashes per second) or some other
suitable value and put code in the OnTimer event like


Private Sub Form_Timer()
If IsNull(Me.fieldname) Then
If Me.Label1.ForeColor = vbBlack Then
Me.Label1.ForeColor = vbRed
Else
Me.Label1.ForeColor = vbBlack
End If
End If
End Sub

or any other desired change (you can use the Forecolor to flash the
text, the Backcolor to flash the background of the entire textbox,
both, ...)

Note that many users find flashing objects on the screen VERY
annoying. Use this technique *SPARINGLY*. If you want to prevent null
entries into a control on a form, consider instead using the Form's
BeforeUpdate event to check the control, and post a polite message and
cancel the addition if it's not valid.

John W. Vinson[MVP]
  #4  
Old December 20th, 2006, 10:40 PM posted to microsoft.public.access.forms
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Make Label Flash

Hi

Regarding John's and Klatuu's answer - not sure where you are but if you are
in the UK and using the DB for emplyees. If you are then you may have quite
a few legal problems with flashing controls. - Check with the local council
Health and Safety dept before you ask employees to use it.

Mind you if it's just for your own use there are no controls on what you
make it look like

--
Buon Natale, Happy Chritmas.

Wayne
Manchester, England.
Scusate,ma il mio Inglese fa schiffo :-)
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.



"John Vinson" wrote:

On Wed, 20 Dec 2006 12:24:00 -0800, CRZ
wrote:

I would like to know how I can make a label on a form flash if a field on
that form has text in it and not flash when the field is null?


You'll need to use the Form's Timer event. Set the Form's Timer
property to 500 (milliseconds, two flashes per second) or some other
suitable value and put code in the OnTimer event like


Private Sub Form_Timer()
If IsNull(Me.fieldname) Then
If Me.Label1.ForeColor = vbBlack Then
Me.Label1.ForeColor = vbRed
Else
Me.Label1.ForeColor = vbBlack
End If
End If
End Sub

or any other desired change (you can use the Forecolor to flash the
text, the Backcolor to flash the background of the entire textbox,
both, ...)

Note that many users find flashing objects on the screen VERY
annoying. Use this technique *SPARINGLY*. If you want to prevent null
entries into a control on a form, consider instead using the Form's
BeforeUpdate event to check the control, and post a polite message and
cancel the addition if it's not valid.

John W. Vinson[MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.