Autoeng
Why me?
- Local time
- Today, 00:59
- Joined
- Aug 13, 2002
- Messages
- 1,302
I have read the numerous postings for how to add a progress bar to a form but have yet to find one that does what I need it to do except a French example that I cannot understand. I have a popup form that starts a macro that runs four individual queries and then closes when complete. I would like to add a progress bar to the form that steps along with the queries until complete.
Query one starts running - progress bar 0%
Query one completes, query two starts - progress bar 25%
Query two completes, query three starts - progress bar 50%
Query three completes, query four starts - progress bar 75%
Query four completes - progress bar 100%, form closes
Here is the code for the OnClick event. Using labels so I can control command button color.
Private Sub Label8_Click()
On Error GoTo Label8_Click_Err
Beep
MsgBox "Press ""OK"" to begin exporting the files for ECN reporting to your C:\My Documents Folder. Please be patient as this will take approximately 1 minute. This form will close automatically when export is completed.", vbInformation, "ECN Report Export"
DoCmd.SetWarnings False
DoCmd.OutputTo acQuery, "RecToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoiavg.xls", False, ""
DoCmd.OutputTo acQuery, "RelToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoidtl.xls", False, ""
DoCmd.OutputTo acQuery, "RecToPendqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopavg.xls", False, ""
DoCmd.OutputTo acQuery, "RelToPendingqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopdtl.xls", False, ""
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmDates"
Label8_Click_Exit:
Exit Sub
Label8_Click_Err:
MsgBox Error$
Resume Label8_Click_Exit
End Sub
If someone would be gracious enough to assist me I would be very grateful.
Autoeng
Query one starts running - progress bar 0%
Query one completes, query two starts - progress bar 25%
Query two completes, query three starts - progress bar 50%
Query three completes, query four starts - progress bar 75%
Query four completes - progress bar 100%, form closes
Here is the code for the OnClick event. Using labels so I can control command button color.
Private Sub Label8_Click()
On Error GoTo Label8_Click_Err
Beep
MsgBox "Press ""OK"" to begin exporting the files for ECN reporting to your C:\My Documents Folder. Please be patient as this will take approximately 1 minute. This form will close automatically when export is completed.", vbInformation, "ECN Report Export"
DoCmd.SetWarnings False
DoCmd.OutputTo acQuery, "RecToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoiavg.xls", False, ""
DoCmd.OutputTo acQuery, "RelToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoidtl.xls", False, ""
DoCmd.OutputTo acQuery, "RecToPendqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopavg.xls", False, ""
DoCmd.OutputTo acQuery, "RelToPendingqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopdtl.xls", False, ""
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmDates"
Label8_Click_Exit:
Exit Sub
Label8_Click_Err:
MsgBox Error$
Resume Label8_Click_Exit
End Sub
If someone would be gracious enough to assist me I would be very grateful.
Autoeng