Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

listbox help

VidsVids Member Posts: 1
Hi, Hope that I am in the right place for help? if not could you please forward this on for me.

I have a text box linked to field called "Category", in a database and I need the list to be displayed in a listbox and also to update itself as I am adding new records in VB.

Please help I have checked the Messageboard but the answer's are archived off.

Thanx (sorry, I am a newbie to VB)

Vids

Comments

  • toeswrtoeswr Member Posts: 6
    Private Sub Form_Initialize()
    List1.Clear
    Dim l As Long
    l = Data1.Recordset.RecordCount
    Data1.Recordset.MoveFirst
    While Data1.Recordset.EOF() = False
    List1.AddItem Data1.Recordset.Fields(0)
    Data1.Recordset.MoveNext
    Wend

    end sub
    ----
    Private Sub save_Click()
    Data1.Recordset.Fields(0) = Text1.Text
    List1.AddItem Text1.Text
    Data1.Recordset.Update
    End Sub
    ----
    Private Sub addnew_Click()
    Data1.Recordset.AddNew
    End Sub



  • Shawn CarterShawn Carter Member Posts: 0

    _____ { http://forcoder.org } free video tutorials and ebooks about || Assembly C++ R C# MATLAB Scratch Go Visual Basic Java Delphi Swift Python Visual Basic .NET Ruby Perl C PL/SQL PHP JavaScript Objective-C Logo ML COBOL Fortran Apex LabVIEW Alice FoxPro Kotlin Awk Hack ABAP Lua Dart VBScript SAS Ada Prolog Scheme D Lisp F# Bash Erlang Rust Scala Clojure Transact-SQL Crystal Julia || ______

Sign In or Register to comment.