help me.....
i m writing the code for an app
i m getting the error invalid use of null.my variable storing null value after the loop execution.first 3 times of loop execution it is saving the correct values.after execution of loop all of sudden it's going to store null value.i don't know why it's storing null value.
the peace of cose is below.
Public Sub LoadPFRGanttChart1(GChart As TeeChart.tCHART, RSRecSet As ADODB.Recordset, TableNamee As String)
Dim lblDt As String
Dim t1 As Integer
Dim Np As Integer
GChart.Series(0).Clear
GChart.Zoom.Undo
If RSRecSet.RecordCount > 0 Then
Np = RSRecSet.RecordCount
RSRecSet.MoveFirst
For t1 = 0 To Np - 1
If Format(RSRecSet("tampEndDtAndTime"), "dd/MM/yyyy") <> Format$(CDate("12/12/2000"), "dd/MM/yyyy") Then
lblDt = CStr(Format$(RSRecSet("tampEndDtAndTime"), "dd/MM/yyyy" & " hh:nn:ss") & " - " & Format$(RSRecSet("tampStartDtAndTime"), "dd/MM/yyyy" & " hh:nn:ss"))
GChart.Series(0).asGantt.AddGantt CDate(RSRecSet("tampEndDtAndTime")), CDate(RSRecSet("tampStartDtAndTime")), 0, lblDt
End If
RSRecSet.MoveNext
Next t1
End If
If RSRecSet.State = adStateClosed Then
RSRecSet.Open
End If
End Sub
GChart.Series(0).asGantt.AddGantt CDate(RSRecSet("tampEndDtAndTime")), CDate(RSRecSet("tampStartDtAndTime")), 0, lblDt
at the above line of code i m getting error especially CDate(RSRecSet("tampEndDtAndTime")) at this point
please help me to solve this problem.
i m writing the code for an app
i m getting the error invalid use of null.my variable storing null value after the loop execution.first 3 times of loop execution it is saving the correct values.after execution of loop all of sudden it's going to store null value.i don't know why it's storing null value.
the peace of cose is below.
Public Sub LoadPFRGanttChart1(GChart As TeeChart.tCHART, RSRecSet As ADODB.Recordset, TableNamee As String)
Dim lblDt As String
Dim t1 As Integer
Dim Np As Integer
GChart.Series(0).Clear
GChart.Zoom.Undo
If RSRecSet.RecordCount > 0 Then
Np = RSRecSet.RecordCount
RSRecSet.MoveFirst
For t1 = 0 To Np - 1
If Format(RSRecSet("tampEndDtAndTime"), "dd/MM/yyyy") <> Format$(CDate("12/12/2000"), "dd/MM/yyyy") Then
lblDt = CStr(Format$(RSRecSet("tampEndDtAndTime"), "dd/MM/yyyy" & " hh:nn:ss") & " - " & Format$(RSRecSet("tampStartDtAndTime"), "dd/MM/yyyy" & " hh:nn:ss"))
GChart.Series(0).asGantt.AddGantt CDate(RSRecSet("tampEndDtAndTime")), CDate(RSRecSet("tampStartDtAndTime")), 0, lblDt
End If
RSRecSet.MoveNext
Next t1
End If
If RSRecSet.State = adStateClosed Then
RSRecSet.Open
End If
End Sub
GChart.Series(0).asGantt.AddGantt CDate(RSRecSet("tampEndDtAndTime")), CDate(RSRecSet("tampStartDtAndTime")), 0, lblDt
at the above line of code i m getting error especially CDate(RSRecSet("tampEndDtAndTime")) at this point
please help me to solve this problem.