progress bar

  • Thread starter Haggr1 via AccessMonster.com
  • Start date
H

Haggr1 via AccessMonster.com

I use the following event to run an update and append query w/o confirmation
messages.. The event can take a few minutes especially when other users are
logged on. I need to show a "real" "progress bar" so the user running that
event can see the progress. I have been though all the help on progress bars
and just can seem to grasp it. I need help. Thanks

Private Sub Command49_Click()
On Error GoTo Err_Command49_Click

With CurrentDb
.Execute "qrystyleappendstyle", dbFailOnError
.Execute "qrystylegary", dbFailOnError
End With

Exit_Command49_Click:
Exit Sub

Err_Command49_Click:
MsgBox Err.Description
Resume Exit_Command49_Click

End Sub
 
S

Scott McDaniel

I use the following event to run an update and append query w/o confirmation
messages.. The event can take a few minutes especially when other users are
logged on. I need to show a "real" "progress bar" so the user running that
event can see the progress. I have been though all the help on progress bars
and just can seem to grasp it. I need help. Thanks

In order to show a useful progress bar, you have to know the StartPoint, EndPoint, and somehow be able to determine
where you are in the process. In the case of executing queries, you have no way of knowing if you're at 10%, 20%, or
65%, since Access doesn't report this to you (be nice if it did!!). You could perhaps guesstimate the time needed to run
your queries and use that to determine your Finish point, then just update the progress bar every second/minute etc, but
this will invariably be wrong and users will begin to wonder exactly what's going on (and if the query runs more slowly
than anticipated, will attempt to do something else and the program will appear to be locked).

You might want to just show the Hourglass before starting your queries:
Private Sub Command49_Click()
On Error GoTo Err_Command49_Click

With CurrentDb

DoCmd.Hourglass True
.Execute "qrystyleappendstyle", dbFailOnError
.Execute "qrystylegary", dbFailOnError
End With

'/perhaps a messagebox here??
MsgBox "Finished updating the tables"
Exit_Command49_Click: DoCmd.HourGlass False
Exit Sub

Err_Command49_Click:
MsgBox Err.Description
Resume Exit_Command49_Click

End Sub

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top