Code to run/rerun progress bar

thisisanemergency

Registered User.
Local time
Today, 17:15
Joined
Oct 25, 2012
Messages
13
I'm using a progress bar solution posted by Oldsoftboss: http://www.access-programmers.co.uk/forums/showthread.php?t=130802. The progress bar should indicate progress on a button click event that initiates various queries.

The problem I have is that the progress bar only runs once all the queries have completed. I have tried inserting the "RunProgressBar" function in different places, but it doesn't have any effect. The function seems to be attached and dependent on the Form_Timer event only.

This is the code for my button click event which sits within my main form:

Code:
Private Sub BtnImport_Click()
 
Call PBFormOpen 'opens the progress bar form
Call InfoStatusDel 'updates a text box on the progress bar form
Call DeleteOldRecords 'runs a delete query
Call InfoStatusImp 'updates a text box on the progress bar form
Call ImportSpreadsheets 'runs saved imports
Call InfoStatusApp 'updates a text box on the progress bar form
Call AppendArchive 'runs an append query

End Sub

I haven't made any changes (except for form name) to the code in the sample database.

My desired result is as follows:
  1. Button click > progress bar form opens
  2. Progress bar runs to full while delete query runs (progress bar form stays open)
  3. Progress bar runs to full while import runs (again, progress bar form stays open)
  4. Progress bar runs to full while append query runs (progress bar form closes)
Basically, I want the progress bar to restart 3 times and the progress bar form to close after the last run.

Advice appreciated as always!
 
Code:
Call PBFormOpen 'opens the progress bar form
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call InfoStatusDel 'updates a text box on the progress bar form
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call DeleteOldRecords 'runs a delete query
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call InfoStatusImp 'updates a text box on the progress bar form
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call ImportSpreadsheets 'runs saved imports
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call InfoStatusApp 'updates a text box on the progress bar form
[B][COLOR=red]    DoEvents[/COLOR][/B]
Call AppendArchive 'runs an append query
[B][COLOR=red]    DoEvents[/COLOR][/B]
 
How embarrassing, so simple! Thanks so much :)
 
note that access includes an intrinsic progress bar which is easy to use

i must say i prefer the longer A2003 bar though, with 20 dots, compared with the current very small bar.
 

Users who are viewing this thread

Back
Top Bottom