Solved

Sleep

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now