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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|