I've tried this but is doesn't seem to work. I get a compile error that says Method or data member not found.
I'm going to put my code below and mark were it's happening.
Thanks
Don
Public ColumnCount As Integer
Public itmX As ListItem
Public sValue As String
Public sFormat As String
Private Sub lvAddRowRSLocal(rs As Recordset, lv As Control, bAutoNumber As Boolean, Optional bDisplayNullAsBlank As Boolean = False)
sRoutine = "lvAddRowRSLocal"
gError.AddRoutine smodule, sRoutine
On Error GoTo Err_Routine
'*************************** ACTIVE CODE ******************************
Dim i As Integer
Dim x As Integer
Dim clmX As ColumnHeader
Dim sFieldName As String
ColumnCount = lv.ColumnHeaders.Count
sFieldName = GetParameter(LVC_FIELDNAME, lv.ColumnHeaders(1).tag)
If bAutoNumber = True Then
Set itmX = lv.ListItems.Add(, , x)
Else
If IsNull(rs(sFieldName)) Then
Set itmX = lv.ListItems.Add(, , "[Blank]")
Else
Set itmX = lv.ListItems.Add(, , CStr(rs(sFieldName)))
End If
End If
For Each clmX In lv.ColumnHeaders
If bDisplayNullAsBlank Then
sValue = "[Blank]"
Else
sValue = ""
End If
If Not clmX.Index = 1 Then
sFieldName = GetParameter(LVC_FIELDNAME, clmX.tag)
sFormat = GetParameter(LVC_FORMAT, clmX.tag)
sValue = FormatListItem(rs(sFieldName), sFormat, bDisplayNullAsBlank)
itmX.SubItems(clmX.Index - 1) = sValue
itmX.ListSubItems(1).ForeColor = vbRed
'It complains on the item above
'Doesn't seem to like the listSubItems
End If
Next clmX
'**********************************************************************
Exit_Routine:
On Error GoTo 0
gError.HandleError
Exit Sub
Err_Routine:
Select Case Err
Case 3265
sValue = "COLUMN NOT FOUND"
Resume Next
Case Else
gError.SetError Err, smodule, sRoutine
Resume Exit_Routine
End Select
End Sub