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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar whilst report opening

Status
Not open for further replies.

xentaur

Programmer
Nov 17, 2003
35
AU
Hi folks

Long time reader, first time poster.

I've got a situation where a report, which contains a lot, and I mean a lot, of calculations, based upon 3 separate queries (for reasons too complex to discuss they must remain separate), forecasts our activity for the next 3 calendar months.

As we are non-profit and working on antiquated equipment the report takes up to 5 minutes to format and I know, despite my repeated reassurances, that our network users are going to think that their machine has crashed whilst they wait for the report to appear.

My VB code consists of one line which opens the report and so I have no loops or progression of commands into which I can intersperse updates to a syscmd or an active x control.

Is there something I can do which will give a very dynamic visual presentation whilst the DB is formatting the report in preparation for display of the report?

perhaps something that I can open prior to the open report command which can be closed by the report 'on open' event procedure?

any suggestions welcomed.

Xentaur.
 
Theres a ton of OCX's out there for this. Just google "Progress Bar" "VBA" and you see. Since you work for poor people, add the words "shareware" and "freeware". There's a bunch of them out there for cheap or free.
 
You could open a form with an animated gif on it (check out for a dll free way) which happily turns around whilst opening the report.
Your gif could be anything from a flashing please wait, to a clock, ticking off the seconds, to a faux progress bar that resets itself when it gets to the top.
I don't think that vbaJock's idea will work as you cannot update the ocx it is impossible to hook into the report opening process, though I have not done any extensive research into it and would be interested to hear otherwise!

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Good question. It is possible to show a progress counter in the Stats Bar or a form while a large report is formatting pages.

Use the following code in the report:

Dim nPage as double

Private Sub Detail_Format ()
‘ only update counter when page changes
If Not nPage=me.Page then
‘ only update counter when page changes
SysCmd acSysCmdSetStatus, "Page: " & Me.Page
DoEvents
nPage=me.Page
end if
End Sub

Private Sub Report_Page()
If Me.Page = 1 Then ‘ close Status Bar
‘ clear the status bar before first page is shown
SysCmd acSysCmdClearStatus
DoEvents
End If
End Sub

You may need to refine this progress. But it should get you going.




 
Thanks for your response,

From the code you've provided I'm assuming the progress bar updates each time a new page is reached in the formatting process. My only problem, all the calculations that the report does, sadly, are presented on a single page.

Any further suggestions would be welcomed.

Cheers.

Xentaur.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top