Solved

Sleep

Posted on 2006-11-25
3
322 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now