Hi...
I need help to to solve the follwing error occurs at the line I made a
commented description in the following code:
error is --> "Method 'Value' of Object 'ITListGridCell' failed"
anybody can help me to solve this..I'll be mo thankfull....
Private Sub Form_Load()
Dim rsJOS As New ADODB.Recordset
Dim CntJos As Integer
Dim i As Integer
TList1.Grid.Cols = 7
TList1.Grid.ShowColTitles = True
TList1.Grid.ShowRowTitles = True
'Specify width of columns in twips
TList1.Grid.ColDefs(0).Width = 600
TList1.Grid.ColDefs(1).Width = 2250
TList1.Grid.ColDefs(2).Width = 1050
TList1.Grid.ColDefs(3).Width = 1200
TList1.Grid.ColDefs(4).Width = 2250
TList1.Grid.ColDefs(5).Width = 1050
TList1.Grid.ColDefs(6).Width = 1200
'Specify fonts for heading cells
TList1.Grid.ColDefs(1).CellDef.Font.Bold = True
TList1.Grid.ColDefs(1).CellDef.Font.Size = 11
TList1.Grid.ColDefs(1).
CellDef.Font.Name = "Arial"
TList1.Grid.ColDefs(2).
CellDef.Font.Name = "Arial"
TList1.Grid.ColDefs(2).CellDef.Font.Size = 11
TList1.Grid.ColDefs(2).CellDef.Font.Bold = True
TList1.Grid.ColDefs(2).CellDef.Font.Italic = True
TList1.Grid.ColDefs(3).CellDef.Font.Bold = True
TList1.Grid.ColDefs(3).CellDef.Font.Size = 10
TList1.Grid.ColDefs(3).
CellDef.Font.Name = "Arial"
TList1.Grid.ColDefs(4).CellDef.Font.Bold = True
TList1.Grid.ColDefs(4).CellDef.Font.Size = 10
TList1.Grid.ColDefs(4).
CellDef.Font.Name = "Arial"
TList1.Grid.ColDefs(5).CellDef.Font.Bold = True
TList1.Grid.ColDefs(5).CellDef.Font.Size = 10
TList1.Grid.ColDefs(5).
CellDef.Font.Name = "Arial"
TList1.Grid.ColDefs(6).CellDef.Font.Bold = True
TList1.Grid.ColDefs(6).CellDef.Font.Size = 10
TList1.Grid.ColDefs(6).
CellDef.Font.Name = "Arial"
'Allow word wrapping for 1st column cells
'TList1.Grid.ColDefs(1).CellDef.MultiLine = 1
'Heading cells of grid:
TList1.Grid.Cells(0, 1).Value = "JOS No"
TList1.Grid.Cells(0, 1).CellDef.BackColor = RGB(255, 255, 0)
TList1.Grid.Cells(0, 2).Value = "Date"
TList1.Grid.Cells(0, 2).CellDef.BackColor = RGB(255, 0, 0)
TList1.Grid.Cells(0, 3).Value = "Ref No"
TList1.Grid.Cells(0, 3).CellDef.BackColor = RGB(0, 255, 255)
TList1.Grid.Cells(0, 4).Value = "Destination"
TList1.Grid.Cells(0, 4).CellDef.BackColor = RGB(0, 255, 255)
TList1.Grid.Cells(0, 5).Value = "Plant"
TList1.Grid.Cells(0, 5).CellDef.BackColor = RGB(0, 255, 255)
TList1.Grid.Cells(0, 6).Value = "Total Quantity"
TList1.Grid.Cells(0, 6).CellDef.BackColor = RGB(0, 255, 255)
''TList1.List(1) = "Main jet"
''TList1.ItemValues(1, VALUE_PRICE).Value = " 9"
''TList1.ItemValues(1, VALUE_ID).Value = 9874831
rsJOS.Open "SELECT * FROM JOSMaster", Conn, adOpenDynamic,
adLockOptimistic
i = 1
'With TList1.ItemGrid
With TList1.Grid
While rsJOS.EOF <> True
.Cells(i, 1).Value = rsJOS.Fields("JOSNo")
.Cells(i, 2).Value = rsJOS.Fields("Date")
.Cells(i, 3).Value = rsJOS.Fields("RefNo")
.Cells(i, 4).Value = rsJOS.Fields("Destination")
.Cells(i, 5).Value = rsJOS.Fields("PlantID")
.Cells(i, 6).Value = rsJOS.Fields("TotalQuantity") '// Giving
error ->Method 'Value' of Object 'ITListGridCell' failed
rsJOS.MoveNext
i = i + 1
Wend
End With
End Sub