Results 1 to 2 of 2

Thread: Populate a list box

  1. #1
    Join Date
    Sep 2013
    Posts
    10

    Populate a list box

    Hi

    I am trying to do the following with visual web developer 2010 (Visual Basic) :
    on the web page i have a combobox that has data from an access table (a category table.)
    when I select a category from the combobox I want the data from another table (items) that have the same category code as the selected category
    to show in a listbox on the same page.

    I did get the combobox to work and I can get the category code and store it in a variable.
    I dont know how to select the correct data and store it in the listbox.
    Can anyone please show me how to do this ?

  2. #2
    Join Date
    Dec 2007
    Posts
    2,288

    Re: Populate a list box

    You can try to do this in a very good way by building a filter expression, check the below code for example:

    Code:
    Private Sub Combo1_AfterUpdate()
    'FILTER BY SELECTED CUSTOMER_ID
    Dim S As String
    Dim V As String
    V = Combo1.Text 'updated from the user's selection
    S = "[CUSTOMER_ID]=" & "'" & V & "'" ' The bound field on your Invoice form
    Me.Filter = S
    Me.FilterOn = True
    End Sub

Similar Threads

  1. Add/remove programs will not populate list
    By Chucky in forum Windows XP Support
    Replies: 4
    Last Post: 25-10-2011, 08:36 PM
  2. Replies: 1
    Last Post: 09-09-2011, 03:38 PM
  3. Populate Text Field Based On Drop-Down List Selection
    By Kaalicharan in forum Software Development
    Replies: 6
    Last Post: 21-07-2010, 09:59 AM
  4. Populate a Drop down list in php from SQL
    By GunFighter in forum Software Development
    Replies: 2
    Last Post: 18-03-2009, 09:08 AM
  5. Add or remove programs won't populate
    By Klums in forum MediaCenter
    Replies: 1
    Last Post: 17-06-2007, 06:38 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,046,872.83782 seconds with 17 queries