Flashing the contents of a text box

J

Jack

Hi,
I have a text box (locked) which is named locked. The contents of the text
box is either 'Y' or 'N'. Now I was wondering if the contents of the textbox
is 'Y' (forecolor = red) then how does one make this Y flash?
Is this possible inAccess? If it is so I would appreciate some link to
article or any help to resolve this issue. Thanks.
 
D

Dorian

Its not advisable to have flashing fields in any application, however, look
up the Timer event in Access Help.
Basically it allows you to fire an event on a variable time basis then you
can flip the value from visible to invisible to make it appear it flashes.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
M

Marshall Barton

Jack said:
I have a text box (locked) which is named locked. The contents of the text
box is either 'Y' or 'N'. Now I was wondering if the contents of the textbox
is 'Y' (forecolor = red) then how does one make this Y flash?
Is this possible inAccess? If it is so I would appreciate some link to
article or any help to resolve this issue.


Make sure the text box's ForeColor property is set to 0
(Black). Then set the form's TimerInterval to something
around 500 and use a Timer event procedure like:

Text0.ForeColor = Text0.ForeColor Xor vbRed

Note: most people find flashing items to be very annoying.
 
S

Stuart McCall

Jack said:
Hi,
I have a text box (locked) which is named locked. The contents of the text
box is either 'Y' or 'N'. Now I was wondering if the contents of the
textbox
is 'Y' (forecolor = red) then how does one make this Y flash?
Is this possible inAccess? If it is so I would appreciate some link to
article or any help to resolve this issue. Thanks.

Use the form's timer for this. For a .5 sec flash, set the form's
TimerInterval to 500 (1000 milliseconds = 1 second). Do this when the
conditions are right for displaying in red. Then, in the Form_Timer event,
include code like this:

If Textbox.Color = vbRed Then
Textbox.Color = Me.BackColor
Else
Textbox.Color = vbRed
End If

Every half a second, the Y will be displayed in red, then the next half
second it will effectively 'disappear'.

To switch off the timer, set TimerInterval to 0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top