Chance1234
IS-IT--Management
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
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