AutoComplete ComboBox Search on Substring for KeyPress

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?bWVtZWFk?=

    AutoComplete ComboBox Search on Substring for KeyPress

    I have a combobox displaying the full name of a customer (e.g. John Smith)
    and would like to go to the LAST name whenever a user presses a key while on
    this combobox. I have looked at the AutoCompleteMod e and AutoCompleteSou rce
    properties of the combobox, but they only key off of the FIRST name (e.g.
    pressing "B" will select "Bob Smith", not "Sam Barnes"). Even FindString and
    FindStringExact only appear to key off of the prefix. This combobox,
    cboCustomer, has a .DataSource set to a DataView (dv) which contains two
    fields, the customer's name (e.g. "John Smith") and their customer number
    (e.g. 12345). The .ValueMember of this combobox is dv.CustomerNumb er and the
    ..DisplayMember is set to dv.FullName. How can I set the AutoCompleteSou rce
    (?) to be a substring (Last Name) of the .DisplayMember (Full Name)? I
    looked at Ken Tucker's response in "Typing in a ComboBox" (04/12/2006) and it
    look interesting, but I do not know if this would help me. Any help is
    appreciated.

    Thank you.
  • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

    #2
    RE: AutoComplete ComboBox Search on Substring for KeyPress

    memead,

    Wouldn't it make more sense to display the name in the combobox as Last,
    First?

    Kerry Moorman


    "memead" wrote:
    I have a combobox displaying the full name of a customer (e.g. John Smith)
    and would like to go to the LAST name whenever a user presses a key while on
    this combobox. I have looked at the AutoCompleteMod e and AutoCompleteSou rce
    properties of the combobox, but they only key off of the FIRST name (e.g.
    pressing "B" will select "Bob Smith", not "Sam Barnes"). Even FindString and
    FindStringExact only appear to key off of the prefix. This combobox,
    cboCustomer, has a .DataSource set to a DataView (dv) which contains two
    fields, the customer's name (e.g. "John Smith") and their customer number
    (e.g. 12345). The .ValueMember of this combobox is dv.CustomerNumb er and the
    .DisplayMember is set to dv.FullName. How can I set the AutoCompleteSou rce
    (?) to be a substring (Last Name) of the .DisplayMember (Full Name)? I
    looked at Ken Tucker's response in "Typing in a ComboBox" (04/12/2006) and it
    look interesting, but I do not know if this would help me. Any help is
    appreciated.
    >
    Thank you.

    Comment

    • Lloyd Sheen

      #3
      Re: AutoComplete ComboBox Search on Substring for KeyPress

      memead wrote:
      I have a combobox displaying the full name of a customer (e.g. John Smith)
      and would like to go to the LAST name whenever a user presses a key while on
      this combobox. I have looked at the AutoCompleteMod e and AutoCompleteSou rce
      properties of the combobox, but they only key off of the FIRST name (e.g.
      pressing "B" will select "Bob Smith", not "Sam Barnes"). Even FindString and
      FindStringExact only appear to key off of the prefix. This combobox,
      cboCustomer, has a .DataSource set to a DataView (dv) which contains two
      fields, the customer's name (e.g. "John Smith") and their customer number
      (e.g. 12345). The .ValueMember of this combobox is dv.CustomerNumb er and the
      .DisplayMember is set to dv.FullName. How can I set the AutoCompleteSou rce
      (?) to be a substring (Last Name) of the .DisplayMember (Full Name)? I
      looked at Ken Tucker's response in "Typing in a ComboBox" (04/12/2006) and it
      look interesting, but I do not know if this would help me. Any help is
      appreciated.
      >
      Thank you.

      I have an implementation that uses a text box and a hidden (until
      typing) listbox. It will present names on a "contains" basis. I am not
      near the box the code is on but will post it tommorow.

      LS

      Comment

      • =?Utf-8?B?bWVtZWFk?=

        #4
        RE: AutoComplete ComboBox Search on Substring for KeyPress

        It would be simpler, yes. The project requirements do not allow for this,
        however.

        "Kerry Moorman" wrote:
        memead,
        >
        Wouldn't it make more sense to display the name in the combobox as Last,
        First?
        >
        Kerry Moorman
        >
        >
        "memead" wrote:
        >
        I have a combobox displaying the full name of a customer (e.g. John Smith)
        and would like to go to the LAST name whenever a user presses a key while on
        this combobox. I have looked at the AutoCompleteMod e and AutoCompleteSou rce
        properties of the combobox, but they only key off of the FIRST name (e.g.
        pressing "B" will select "Bob Smith", not "Sam Barnes"). Even FindString and
        FindStringExact only appear to key off of the prefix. This combobox,
        cboCustomer, has a .DataSource set to a DataView (dv) which contains two
        fields, the customer's name (e.g. "John Smith") and their customer number
        (e.g. 12345). The .ValueMember of this combobox is dv.CustomerNumb er and the
        .DisplayMember is set to dv.FullName. How can I set the AutoCompleteSou rce
        (?) to be a substring (Last Name) of the .DisplayMember (Full Name)? I
        looked at Ken Tucker's response in "Typing in a ComboBox" (04/12/2006) and it
        look interesting, but I do not know if this would help me. Any help is
        appreciated.

        Thank you.

        Comment

        Working...