Why it is not loading or adding item in the listbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ferwayne Yalung
    New Member
    • Jan 2011
    • 3

    Why it is not loading or adding item in the listbox?

    Private Sub Form_Load()
    Label2.Caption = login.txtuser.T ext
    sa = Label2.Caption
    With Adodc2.Recordse t

    subjsec = !course + " " + !studsec
    MsgBox subjsec, , "System"
    .Filter = "IDnumber = '" + Label2.Caption + "'"
    End With


    With Adodc1.Recordse t
    .Filter = "subjsectio n='" + subjsec + "' and isdeleted = 0"

    abc = .RecordCount

    Do While abc > 0

    List1.AddItem (!subjcode)
    List3.AddItem (!instructor)
    List2.AddItem (!subjdesc)

    .MoveNext
    abc = abc - 1
    Loop
    End With
    End Sub
    Attached Files
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Your syntax is right, maybe the problem aren't the listboxes; use a couple of msgboxes to chek two things:

    1) abc > 0
    2) you're actually sending some values to your listboxes

    msgbox (abc)
    msgbox (!subjcode)

    Comment

    Working...