dcsimg
Results 1 to 3 of 3

Thread: Textbox, combobox or?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2008
    Posts
    27

    Textbox, combobox or?

    I have a form on which I want the user to be able to select a name from a list.
    The list needs to be populated from an table in my dataset.
    I'd like the user to begin typing and have an autocomplete append select type feature let them zero in on the person they want as they type.

    My question is, what type of control would work best for this?

  2. #2
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: Textbox, combobox or?

    Combobox bound to the dataset, then set the properties of the combobox to autocomplete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2008
    Posts
    27

    Re: Textbox, combobox or?

    Thanks, I have done that and it works fine.

    Now I would like to, at form load time, check to see if the table already has data in that column and if so have the combobox set to that item. When I run the following code the index comes up with -1.
    I am new to VB and am trying but I seem to be missing the correct way to code this.
    Any ideas?

    'Serving Deputy
    If Me.ServiceRecord("Deputy_Number").ToString > "" Then
    Dim srchDeputy As String = Me.ServiceRecord("Deputy_Number").ToString
    Dim index As Integer
    index = ServersComboBox.FindStringExact(srchDeputy)
    If index >= 0 Then
    ServersComboBox.SelectedIndex = index
    End If
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width