Flashing labels

Maritza

Information *****
Local time
Today, 11:10
Joined
Nov 13, 2002
Messages
54
All,

I found a thread in the forums about a flashing label, however that particular example uses the form timer and I don't want to use a timer. This is what I have;

on a combo box after Update event I check for records in a specific table, If we have records I want to have a label flash in the screen a few times, (maybe ten times).

Right now I have a routine like this,

For X = 1 to 1000
if x mod 2 = 0 then
lbl.visible = true
else
lbl.visible = false
end if
next x

The problem is that it goes thru the For Next so quickly that you can't see any changes in the form.

Any ideas. I don't want to use a timer, I only want that to happen after the combo box is updated and the recordcount is greater than 0.

Thanks for your help
 
Can't you simply increase the 1000 to say 10000 or 20000?

???

Never mind the above statement - Instead, can't you place a timer loop in the middle somewhere. Just another for/next loop to slow it up a bit...
 
Last edited:
Insert this:

Code:
Application.Wait Now()+TimeValue("00:00:01")
DoEvents
 
Of course, the user won't be able to do anything for 1,000 seconds if you do it that way.

The form timer enables other stuff to happen that isn't modal.
 
hmmmmm

why don't you want to use the timer?

izy
 
Thanks for your ideas.

Tom,

I copy the application.wait into my code and I received a compilation error, "method or data member not found". Do I need to declare the current application as an object?


Thanks
 
Code:
For X = 1 to 1000
    if x mod 2 = 0 then
          lbl.visible = true
    else
          lbl.visible = false
    end if

For t = 1 to 10000; next t

next x
 
Maritza said:
I copy the application.wait into my code and I received a compilation error, "method or data member not found". Do I need to declare the current application as an object?
Sorry, I forgot that Wait is an Excel object - however, you can use it. Add Excel to your references, then use:

Code:
Excel.Application.Wait Now()+TimeValue("00:00:01")

You do know that the user won't be able to do anything while this is running, right?
 
Thanks for the reply. I'm going to try it later. I'm also contemplating to send a message box instead.
 
How about a timed message box that will automatically disappear if the user does not click the okay button within 10 seconds?

'Put this at the top of a public module [not a form module]
Code:
'Used with a timed message box
Public Property Get oMsgBox() As Object
    Set oMsgBox = CreateObject("WScript.Shell")
End Property
'Put this in your routine to call the time message box when needed
Code:
oMsgBox.PopUp "Hey everybody, we have records!", 10, "Records Found", vbInformation
 

Users who are viewing this thread

Back
Top Bottom