1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Populate TextBox with Selection from Combobox selection

Discussion in 'Software Development' started by romeh, Mar 15, 2011.

Thread Status:
Not open for further replies.
  1. romeh

    romeh Thread Starter

    Mar 9, 2011
    I have a HUGE problem.
    I have an access 2007 database. I have used it im my VB 2008 project. I have a table called Reps (where the reps ID's are stored), and I have a table for each rep with their corrosponding customer's names.
    Table: Reps(1)
    Field: Reps (2)

    Table: Spencer Customers (3)
    Field: SpencerCustomers(4)

    Then in my VB form, i have dragged the entire database to my form. I have created a combobox where you can select the reps name, from the Reps Table (2).
    NOW this is where it is becoming tricky.
    In the "Customer" textbox, This is what i want:
    When you have selected RepsCombobox's selected rep name, i want only spencer's customers to appear in the "customer textobx". As a Combobox. Make sense to anyone? It would be easy to populate just one record, but i want to populate it with the corrosponding rep's customer list.

    I have gotton this far:
    Prvate Sub CustomerTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerTextBox.TextChanged
    If RepComboBox.SelectedIndex = "Spencer" Then
    RawMaterialsDataSet.Spencer_Customers.SpencerCustomersColumn = CustomerNameString. (I dont think this is right or what i should be doing further)

    End If

    and also tried this:
    Private Sub RepComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RepComboBox.SelectedIndexChanged
    If RepComboBox.SelectedIndex = 1 Then
    (Now how do i tell VB to go look for the corrosponding rep's table? I want to say something like, Open, View, Get, i just cant get my head around it)
    End If

    Im very new to VB... Any one who can assist?

    Kind regards

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/986035

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice