Solved

Sleep

Posted on 2006-11-25
3
324 Views
Last Modified: 2010-04-30
I have an app that I am checking another file on a server, I am doing a ton of things in between, and on the server end, but my app doesnt take into effect the server ends processing time (can take upto 2-5 seconds) so I put a Sleep function in....

The progress bar works fine, but the text does not it just shows the last message only.

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Updater.currentmessage = "Establishing Connection"
ProgressBar.Value = 10
Sleep (2000)
Updater.currentmessage = "Connection Established"
ProgressBar.Value = 20
Sleep (2000)
Updater.currentmessage = "Checking Versions"
ProgressBar.Value = 30
0
Comment
Question by:B_Dorsey
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 75 total points
ID: 18012060
Try this (by placing the DoEvents statement before each sleep statement)

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Updater.currentmessage = "Establishing Connection"
ProgressBar.Value = 10
DoEvents
Sleep (2000)
Updater.currentmessage = "Connection Established"
ProgressBar.Value = 20
DoEvents
Sleep (2000)
Updater.currentmessage = "Checking Versions"
ProgressBar.Value = 30
DoEvents
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 18012067
OMGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG!

To think I stayed up all night for that...... Im a LOSER! ...lol

VERY BIG THANKS

b
0
 
LVL 29

Expert Comment

by:Nightman
ID: 18012074
Don't knock yourself - usually a second pair of eyes makes a world of difference.

I wasted 3 hours the other day debugging and getting frustrated, only to finally figure out I was connected to the wrong database;)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question