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

OLE Objects Waiting for object to update before continuing with code

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
Having one of those days, I have a form which contains a chart, the data behind that chart is linked to a listbox on another form. now the code works perfectly below if you step through it but when i try and run it i get teh same graph everytime


please help or alternativly tell me where i can get a shot gun


Private Sub Command21_Click()
Dim oleGrf As Object

Dim strFileName As String
Dim strFilter As String

Dim CntCtr As Integer


For CntCtr = 1 To 17
Me.List19.Value = CntCtr
DoCmd.SetWarnings False
DoCmd.OpenForm "frmchart"


GODDAMIT:
Dim Flibble As Boolean

Flibble = IsLoaded("frmchart")

If Flibble = False Then GoTo GODDAMIT


Set oleGrf = Forms!frmchart.OLEchart

strFileName = "C:\temp\Trends" & CntCtr & ".jpeg"
oleGrf.Export FileName:=strFileName

DoCmd.Close acForm, "Frmchart"
strFileName = ""
Set oleGrf = Nothing



Next

End Sub

Function IsLoaded(ByVal strFormName As String) As Integer
IsLoaded = False
Dim frm As Form
For Each frm In Forms
If frm.Name = strFormName Then
IsLoaded = True
End If
Next frm
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top