P
pmacdiddie
Sorry, I know this has been done 1000 times. The problem is i need
to
loop though a recordset and I dont know the field names, so they have
to be looked up. When i pass them to get the values, it passes as a
literal.
fcount = rs.Fields.Count
'Debug.Print fcount
For i = 0 To fcount - 1
StrText = StrText & "rs![" & rs.Fields(i).Name & "] & " ++++++
THIS PART WORKS
Debug.Print StrText
ctGrid0.AddColumn rs.Fields(i).Name, rs.Fields(i).Size
ctGrid0.ColumnSortable(i) = -1
If fcount - i = 1 Then
Do While Not rs.EOF
ncount = ctGrid0.AddItem(StrText) ****** Problem is here,
HERE IT IS LITERAL
StrText is interperted as string
rs.MoveNext
Loop
rs.Close
End If
Thanks in advance for the help.
to
loop though a recordset and I dont know the field names, so they have
to be looked up. When i pass them to get the values, it passes as a
literal.
fcount = rs.Fields.Count
'Debug.Print fcount
For i = 0 To fcount - 1
StrText = StrText & "rs![" & rs.Fields(i).Name & "] & " ++++++
THIS PART WORKS
Debug.Print StrText
ctGrid0.AddColumn rs.Fields(i).Name, rs.Fields(i).Size
ctGrid0.ColumnSortable(i) = -1
If fcount - i = 1 Then
Do While Not rs.EOF
ncount = ctGrid0.AddItem(StrText) ****** Problem is here,
HERE IT IS LITERAL
StrText is interperted as string
rs.MoveNext
Loop
rs.Close
End If
Thanks in advance for the help.