Something like (from one of my existing AXP databases):
Private Sub MSLBSelectAll(ctlListBox As Access.ListBox)
Dim intHeaderRow As Integer
Dim intIndex As Integer
On Error GoTo MSLBSelectAll_Err
Application.Echo False, "Processing ..."
intHeaderRow = Abs(CInt(ctlListBox.ColumnHeads))
For intIndex = 0 + intHeaderRow To ctlListBox.ListCount -
1
ctlListBox.Selected(intIndex) = True
Next intIndex
MSLBSelectAll_Exit:
Application.Echo True
Exit Sub
MSLBSelectAll_Err:
Select Case Err.Number
Case 0
Case Else
MsgBox "Error " & Err.Number & ": " &
Err.Description & vbCrLf & vbCrLf & _
"(Programmer's note:
Form_frmPrePivot_LL.MSLBSelectAll)" & vbCrLf, _
vbOKOnly + vbCritical, "Run-time Error!"
End Select
Resume MSLBSelectAll_Exit
End Sub
(beware of wrapping on the post).
HTH
Van T. Dinh
MVP (Access)