Results 1 to 4 of 4

Thread: LIST VIEWS

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Post

    Any one tell me how to populate a list view box with this

    Dim Index As Long

    If (loadedcheck) Then Exit Sub

    Index = 0

    Do
    If (Index > 0) Then
    Load CheckGDW(Index)
    CheckGDW(Index).Top = CheckGDW(Index).Height * Index + CheckGDW(Index).Top
    End If

    CheckGDW(Index).Visible = True
    CheckGDW(Index).Caption = rs!CustomerID

    Index = Index + 1
    Call rs.MoveNext

    Loop Until rs.EOF()
    loadedcheck = True

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    </ tested \> & // Working \\

    I'm at work so I don't have time for full documentation but
    if you read this you should get the idea..
    change the db ctrls and references to yours
    tested it...it doesn't load textboxes on your form
    it loads a listview with checkboxes....



    Private Sub Form_Load()

    ListView1.Checkboxes = True

    Dim l As Long
    Dim dblRnd As Double
    Dim dteRnd As Date
    With ListView1
    ' Add three columns to the list - one for each data type.
    ' Note that the data type is set in the column header's
    ' tag in each case
    '
    .ColumnHeaders.Add(, , "String").Tag = "Customer ID"
    '
    ' Set the column alignment - has no bearing on the sorts.
    '
    .ColumnHeaders(1).Alignment = lvwColumnLeft
    End With

    '
    ' Set BorderStyle property.
    ListView1.BorderStyle = ccFixedSingle
    '
    ' Set View property to Report.
    ListView1.View = lvwReport
    '
    Dim Index As Long

    Dim sql
    sql = "select * from Yours"
    Data1.RecordSource = sql
    Data1.Refresh

    ' Populate the list with data

    While Not Data1.Recordset.EOF
    With ListView1.ListItems.Add(, , Index & " " & Data1.Recordset!CustomerID)
    Index = Index + 1
    End With

    Data1.Recordset.movenext

    Wend

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Post list view

    Will this display a listview with check boxes in scrollable?

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    I'v since deleted the project I used to test my code
    Copy and paste it and see what you get.
    It is better than the checkboxes cause I wrote
    that one as well but didn't post it cause I was
    waiting for an answer to a question on your question.


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width