Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7520731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:07:10+00:00 2026-05-30T02:07:10+00:00

Hi I need some help over here… how do i change the display member

  • 0

Hi I need some help over here… how do i change the display member of a ComboBox after i have entered a code in a textbox that it represent the combobox value??

example

Code: 02-001 Combobox: Provider X

if i change the code the provider combobox must change and if i change the provider combobox the code should change!.. i haven’t found any help.. heres little code I remember

if e.keychar = chr(13) Then
    combobox.valuemember = textbox.text
    combobox.displaymember = me.stockdataset.selectprovider(@textbox.text)
end if

this code change the combo box display member but if I change the comobox by clicking it the code on the textbox doesnt change, to its corresponding code…??
please help

….the combo box is bound to the provider tables….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:07:11+00:00Added an answer on May 30, 2026 at 2:07 am

    This is wrong binding way….This is how you do it:
    I have simulate your case by a simple form with a combobox and a textbox
    and a datatable with 2 columns “Code” and “Description”

    and here the Code (if you please, dont forget to mark my answer as Right):

    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Try
    
                Me.KeyPreview = True'To Enable the Key events : KeyDown, KeyPress and KeyUp
    
                Dim dt As New DataTable("T")
                dt.Columns.Add(New DataColumn("Code"))
                dt.Columns.Add(New DataColumn("Description"))
                For i = 1 To 10
                    Dim r As DataRow = dt.NewRow
                    r("Code") = "Code" + CStr(i)
                    r("Description") = "Desc" + CStr(i)
                    dt.Rows.Add(r)
                Next
    
                With ComboBox1
                    .ValueMember = "Code" ' This is case sensitive 
                    .DisplayMember = "Description" ' This is case sensitive 
                    .DataSource = dt
                End With
    
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub
    
        Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click
            SetComoboValue()
        End Sub
    
        Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
            If e.KeyCode = Keys.Enter Then SetComoboValue()
        End Sub
    
        Private Sub SetComoboValue()
            Try
                If Not String.IsNullOrEmpty(TextBox1.Text) Then
                    ComboBox1.SelectedValue = TextBox1.Text
                End If
            Catch ex As Exception
                MsgBox("Ooops, Invalid code !!!")
            End Try
        End Sub
    End Class
    

    So when you enter “Code3” and hit Enter or Click the TextBox1, the ComboBox1 will display “Desc3”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help over here to understand how the model relationship works on
I really need some help here, we are trying to use our player over
Need some help about with Memcache. I have created a class and want to
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help assigning a mouseover event to display some icons that start out
I need some help from the shell-script gurus out there. I have a .txt
I need some help. I have an app that is based on UITabBarController. It
Okay, I am stumped on this one and need some quick help. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.