Question : How to wait for a chart in a form to fully load before proceeding with code

This is a follow up to what I was working on with question http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23855757.html?cid=748#a22988595

From a form I have a button that opens another form grabs the chart data inside of it and create an image out of it.  The Chart also filters based off parameters inside the original form.  The problem I am running into is the code to create the image runs before the chart finishes loading.  

I've attatched my sample database.  If I uncomment the code to stall the code for a second, it sort of fixes the issue in this case.  However if the chart takes longer then a second this will no longer work, therefore I need a better solution.  Is there a way to check if the chart has finished loading before proceeding with the code?  I've tried all sorts of things and have not been able to figure it out.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
DoCmd.OpenForm "Form1", acNormal, , , , acWindowNormal, ""
     Forms!Form1!Graph1.width = txtWidth.Value * 15
     Forms!Form1!Graph1.Height = txtHeight.Value * 15
 
    ' tmr = GetTickCount + (1000)
    ' While GetTickCount < tmr
    '     DoEvents
    ' Wend
     
     Set grpApp = Forms!Form1!Graph1.Object
     grpApp.Export txtExportLocation.Value & "\" & txtFileName.Value & txtExtension.Caption
     Forms!Form1!Graph1.Locked = False
     Forms!Form1!Graph1.Enabled = True
     Set grpApp = Nothing
     Forms!Form1!Graph1.Action = acOLEClose
     DoCmd.Close acForm, "Form1", acSaveNo

Answer : How to wait for a chart in a form to fully load before proceeding with code

The resetting of the graph's row property was done by replicating the SQL string that was in Form1.  I noticed that all that is necessary is to set the graph's row source to what is already there. So the line of code I had

   Form_Form1.Graph1.RowSource = "SELECT Table1.name, Count(Table1.name) AS CountOfname FROM Table1 WHERE ((([fiscalyear])='" & cmbFiscalYear & "')) GROUP BY Table1.name;"

could be replaced with

   Form_Form1.Graph1.RowSource = Form_Form1.Graph1.RowSource

 
Revised file
 
Random Solutions  
 
programming4us programming4us