Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar???

Status
Not open for further replies.

rss01

Technical User
Oct 10, 2001
125
US
I have a form with a import command button that runs thru a series of import data than running some update queries. I would like to add a progress bar that shows what query is running and the status of the query. Does anybody have any ideas or direction to point me in.
 
Check out on line help for the SysCmd method. It may do what you want (Display progress meter, etc)
 
Packaged within Access are some Active X controls, one of which is a progress bar which can be placed on a form. If you use the SysCmd it just puts the status bar in the status bar at the bottom of the screen which hardly anyone notices. I placed the Active X progress bar on my form and so that the user was aware of the progress of an export macro. By placing progress bar fill commands between the various exports it appears that the progress bar is truely tracking the export. You could also place a text box on your form and place text messages into your code to display at various times. Here's the code I used.

Private Sub btnExport_Click()
On Error GoTo btnExport_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
ActiveXCtl11.Value = 10
Me.Repaint
DoCmd.OutputTo acQuery, "RecToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoiavg.xls", False, ""
ActiveXCtl11.Value = 25
Me.Repaint
DoCmd.OutputTo acQuery, "RelToImpqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtoidtl.xls", False, ""
ActiveXCtl11.Value = 50
Me.Repaint
DoCmd.OutputTo acQuery, "RecToPendqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopavg.xls", False, ""
ActiveXCtl11.Value = 75
Me.Repaint
DoCmd.OutputTo acQuery, "RelToPendingqry", "MicrosoftExcel(*.xls)", "c:\my documents\rtopdtl.xls", False, ""
ActiveXCtl11.Value = 100
Me.Repaint
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmDates"
DoCmd.Close acForm, "frmprint"


btnExport_Click_Exit:
Exit Sub

btnExport_Click_Err:
MsgBox Error$
Resume btnExport_Click_Exit

End Sub

Autoeng
 
Thank you. This is just what I wanted. If I wanted to add a label that displays the name of each query as it changes where would I add that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top