I have a progress bar that updates based on the line:
Call ProgressBar(X)
Where X indicates the percentage that the bar displays as 'complete'.
I've roughly calculated various time intervals throughout the code and placed the line several places throughout. It's at the point where it runs quite smoothly for the majority of the code but only half of the bar, with the problem being a forced jump from 10% to 60%.
I'm using an ADODB connection to run a SQL query in the code (I can't take it out of the code because I'm passing variables through it). The jump from 10 to 60 is either side of the line where I'm executing the query
Set rs = conn.Execute(QryND)
where rs is defined as ADODB.Recordset and conn as ADODB.Connection.
I guess ideally what I'm after would be to know if it's possible to say:
Call ProgressBar(10)
'code to the effect of: "in x seconds, execute the next line but in
'the meantime continue with the code
Call ProgressBar(20)
'code to the effect of: "in 2x seconds, execute the line but in the
'meantime continue with the code
Call ProgressBar(30)
Set rs = conn.Execute(QryND)
Or something to that effect.
Alternatively a means of running the query in the background and continuing the code up to a point. Eg
Call ProgressBar(10)
'instruct to run in backrgound:
Set rs = conn.Execute(QryND)
Call ProgressBar(10)
'wait x seconds
Call ProgressBar(20)
'wait x seconds
.
.
.
'Stop running query in background (in case it hasn't finished)
Do either of these sound possible?