VisibleCount, VisibleItems Properties Example

The following sample code uses the VisibleCount and VisibleItems properties to display the fields in all the visible records of a DataList control:

Private Sub Command1_Click()
Dim I As Integer, fld As Field, msg As Variant

For I = 0 To DataList1.VisibleCount - 1
  Data1.Recordset.Bookmark = DataList1.VisibleItems(I)
  msg = ""
  For Each fld In Data1.Recordset.Fields
    msg = msg & fld.Value & "-"
  Next
  MsgBox msg
Next I

End Sub