Hello all

24sharon

Registered User.
Local time
Today, 15:42
Joined
Oct 5, 2004
Messages
147
I have 2 textboxes in a form, for example
text_a
text_b

if I write in text_a 0-10 then text_b=small
if I write in text_a 200-300 then text_b=big...

to insert the value its not a problem.

but I want that after that I insert the value the textbox flashing.
change the backcolor to green and red and green and red....

if I wrote:
Code:
Me.text_b = "big"
Me.text_b.BackColor = 65280 ' green
Me.text_b.BackColor = 255 'red
Me.text_b.BackColor = 65280 ' green
Me.text_b.BackColor = 255 'red
I cant see the flashing.
is there an idea to flash AfterUpdate.


I know to flashing by the timer
Code:
Private Sub Form_Timer()
If Me.text_b.BackColor = 255 Then
Me.text_b.BackColor = 65280 ' green
ElseIf Me.text_b.BackColor = 65280 Then
Me.text_b.BackColor = 255 'red
Else
Me.text_b.BackColor = 255
End If
End Sub
but I dont know to flash afterupdate

thanks
s.
hope that you anderstand me :(
 
Last edited:
Not sure why you would want to do this, but the reason it doesn't work is because in your code it runs through all the sequence faster than you can perceive, then shows the last colour indefinitely.

No guarantees, but you could try something like:

Code:
dim startTime as Time
dim endTime as Time
dim myLoop as integer

startTime = Now()
endTime = dateadd(now() + 5)
myLoop = 1

while startTime < endTime
if  IsInt(myLoop / 2) then
Me.text_b.BackColor = 65280 ' green
else
Me.text_b.BackColor = 255 'red
end if

if IsInt(myLoop / 2) then
myLoop = 1
else
myLoop = 2
end if

startTime = Now()
endTime = dateadd(now() + 5)

Loop

I don't think it will work, but hopefully you get the idea. Wait for five seconds then, depending whether you've been round an even number of times turn it green or red

Or something. I'm tired, and I'm not sure it says what I think

Nick
 
S,

Don't know if this is worth the effort.

Use the AfterUpdate event of the field.
Set timer.
Set Color
Set invisible

When timer fires:
Toggle visible (Make it flash)

Use OnCurrent event of form to set timer = 0 (Need to make it stop)

Wayne
 
sorry

but I didnt success.

zip file attach>>>

text_a
text_b
text_c.

I want afterupdate text_a that text_b flashing like text_c (but just 5 or 6 flashing)

thanks
s.
 

Attachments

First, I cannot download your example because of site security regulations. So this is a guess on my part, but I've done something like this.

OK, here is the deal...

On a form, you have text boxes. Normally they are some color. You want to put a "classifier" in a second box based on the first box's contents. THEN you want the classifier to flash.

This is not going to happen in one event. The AfterUpdate event on the first box can be used to put the classifier in the second box. (BIG or SMALL or whatever other word makes you happy). But flashing requires a different kind of event to fire - a time-based event, which is a FORM function, not a field or text-box (control) function.

When you want flashing or time-based color changes, you need to set the form.timer to some number (of milliseconds). That number gets counted down to zero. When it reaches zero, you trigger a Timer event, which is related to the FORM, not any single control.

In the OnTimer event, you would have to scan the controls on your form (or have a list to visit) where you would look at the value or the foreground color or some other indicator that you decide to use. If it is one sense of the indicator, flip it to the other sense.

Now, the next step, and this is important, is to RELOAD THE TIMER. (It is 0 right now 'cause it counted down, remember?) The next time the timer reaches zero, do it again. Only this time, you switch the indicators back to what they were before the previous timer event.

Last step - when you are about to unload the form, just set the timer to 0 to turn it off.
 
thanks

:)

There is a very good man that gives me an example
<zip file attach>

write into text_a something…
 

Attachments

Users who are viewing this thread

Back
Top Bottom