ActiveX modifications; watch ocxCTL, since that is the ActiveX listbox
being filled:
Function ListBoxFill (ocxCTL As Object, strQuery As String, intSubItems
As Integer, intFormatWidth As Integer) As Boolean
'variables for current data
Dim dbcurrentdb As DAO.Database
Dim rsCTL As DAO.Recordset
Set dbcurrentdb = currentdb()
Dim intCount As Integer
Dim ocxRows As ListItem
Dim Response As Long
On Error GoTo ErrorTrap
Set rsCTL = dbcurrentdb.OpenRecordset(strQuery, dbOpenSnapshot)
With ocxCTL
.listitems.Clear
.ColumnHeaders.Clear
End With
If intFormatWidth = intFormattingWidth0 Then
With ocxCTL
.ColumnHeaders.Add , , "", 1100
End With
End If
If intFormatWidth = intFormattingWidth1 Then
With ocxCTL
.ColumnHeaders.Add , , "", 1870
End With
End If
If intFormatWidth = intFormattingWidth2 Then
With ocxCTL
.ColumnHeaders.Add , , rsCTL.Fields(0).Name, 800
.ColumnHeaders.Add , , rsCTL.Fields(1).Name, 3000
End With
End If