Full Version: Query Event, Pivot Chart, Displaying A Message
UtterAccess Forums > Microsoft® Access > Access Forms
I'm trying to learn how to use the Query event of pivot charts.
I'm using query by form technique to display a pivot chart based on a query.
Oneed to avoid the user to run a new query while another one is running.
This has been really difficult because of the windows "latent click memory".
Then, I'm trying at least to let the user know there is a query running.
I want to try this first with a message, and later with a progress bar.
I think I have to use the query event of the pivot chart.
But I couldn't make it work jet.
Any advice is really appreciated.
Well, it seems the Query Event is just available for Pivot Tables.
So I'm trying now the AfterFinalRender Event.
When I use it, the MsgBox appears 2 times always, and if I hover the PivotChart or if I try to close it, it appears... very annoying.
Any ideas how can I control that?
Private Sub Form_AfterFinalRender(ByVal drawObject As Object)
MsgBox "The PivotChart View has fully rendered."
End Sub
why not on the button click event, display a modal popup form (opened normally, not as a dialog) then on the AfterFinalRender, close the form? That way, it shouldn't matter whether AfterFinalRender fires twice since the form should be closed anyway.
Do you mean like creating my own MsgBox?
Essentially, yes.
Just be sure to set the form's PopUp and Modal property to Yes (it's in the Other tab) so the user can't do anything with it until it goes away by the AfterFinalRender event.
But in that case I can use a progress bar (form) instead.
Never done that before, so I'll have to do some tests.
Well, I think I'm close enough to get this thing solved.
Ocreated a form with a label that serves as a "progress bar"
That DoCmd.Openform is the first instruction in the click event that fires the query.
The form opens maximized, but the progress bar doesn't move until the query is finished.
After that, the progress bar advances, giving some time to the pivotchart to "stabilize", and then close.
Since the first instruction in the click event is the DoCmd.OpenForm, the user cannot break Access by keep clicking controls.
orm properties are modal: No and Popup: No
Therefore, I would like to ask you, what benefits have to set the Modal property to Yes?
PopUp: Keep a form on the top of other forms at all time.
Modal: The form will not allow you to give focus to another until you've closed the modal form.
If you don't set Modal to yes, users can just click on the first form and mess with controls. Modal prevents users from being able to do that and thus must wait until the form is closed away.
Note that when you do a OpenForm, you also can use WindowMode:=acDialog but that is not the same thing - when you open using acDialog, the code in your first form will suspend and wait for the 2nd form to close. Thus you want to open 2nd form normally so your code in first form can keep running the query & pivot table buildups.
Thank you man!
Then I'm going to change those properties.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.