shovels
Apr 5th, 2000, 11:53 PM
Hi,
I'm using the following code to populate a FlexGrid with info from an Access DB Table. How can I adapt or supplement the code so that the column names from the Db table are also displayed.
I need to be able to get the column headings at run time as the info being displayed will be different each time and will also be obtained from different tables each time.
Any suggestions would be greatfully appreciated,
cheers,
shovels
Here's the code I'm using:-
mfgFlex.Clear
k = rs.RecordCount
j = rs.Fields.Count
mfgFlex.Rows = k + 1
mfgFlex.Cols = j + 1
With mfgFlex
lngRow = 1
Do Until rs.EOF
For lngCol = 0 To rs.Fields.Count - 1
'MsgBox rs.Fields.Item(lngCol)
.TextMatrix(lngRow, lngCol + 1) = rs(lngCol)
Next lngCol
rs.MoveNext
lngRow = lngRow + 1
Loop
End With
I'm using the following code to populate a FlexGrid with info from an Access DB Table. How can I adapt or supplement the code so that the column names from the Db table are also displayed.
I need to be able to get the column headings at run time as the info being displayed will be different each time and will also be obtained from different tables each time.
Any suggestions would be greatfully appreciated,
cheers,
shovels
Here's the code I'm using:-
mfgFlex.Clear
k = rs.RecordCount
j = rs.Fields.Count
mfgFlex.Rows = k + 1
mfgFlex.Cols = j + 1
With mfgFlex
lngRow = 1
Do Until rs.EOF
For lngCol = 0 To rs.Fields.Count - 1
'MsgBox rs.Fields.Item(lngCol)
.TextMatrix(lngRow, lngCol + 1) = rs(lngCol)
Next lngCol
rs.MoveNext
lngRow = lngRow + 1
Loop
End With