Results 1 to 5 of 5
  1. #1
    Joy4hacks's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Happy

    Question Need help using Autosuggest in a textbox and pass the data to textboxes.

    Simply i want to say that my problem is I am using an autosuggest in a textbox.....and when the textbox suggest..example..Firstname and Lastname
    Ill search for last name...then that textbox would display Lastname,Firstname...in the meantime my textbox got this code:

    con.Open()
    Dim dt As New DataTable("Companies")

    Dim rs As New OleDb.OleDbDataAdapter("Select * from Companies where Company_Name like '%" & TextBox1.Text & "% ' ", con)
    rs.Fill(dt)




    DataGridView1.DataSource = dt
    DataGridView1.Refresh()

    Label1.Text = dt****ws.Count

    rs.Dispose()
    con.Close()

    If Val(Label1.Text) = 1 Then

    Dim a1, a2 As String
    Dim i As Integer
    i = DataGridView1.CurrentRow.Index

    a1 = DataGridView1.Item(0, i).Value
    a2 = DataGridView1.Item(1, i).Value
    TextBox4.Text = a1
    TextBox5.Text = a2
    End If



    and so when I append that suggested Lastname,Firstname ...the data from gridview won't find it..

    pls help me..

  2. #2
    Raow's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Location
    47°37′39″N 122°14′32″W
    Posts
    2,720
    Reputation
    140
    Thanks
    594
    i Highly doubt that this code is yours, but try using a a comx or something, and as you type, the suggestions pop up in the comx?
    oh, and next time when you post code please use the code tags.
    Last edited by Raow; 02-17-2013 at 09:36 PM.

  3. #3
    Joy4hacks's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Happy
    ^^..thanks for your idea but using comx is the same with textbox and i dnt want to use comx because it has a dropdown arrow.....and i know why my datagridview cant find the data from textbox its because of that line ("Select * from Companies where Company_Name like '%"& Textbox1.text & "%' ",con)
    because of this...if only i could code this as ("Select * from Companies where Company_Name+ Contact_Number like '%"& Textbox1.text &"%' ",con)...and yeah I forgot...im using companyname and contact number instead of First_Name and Last_Name. Sorry ^^..but i think its the same idea so..i forgot to write cause im testing it on my other program..that is using that company_name and contact_number lol...^^..thank you.

  4. #4
    Joy4hacks's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Happy
    TextBox1.AutoCompleteCustomSource.Add(r.Item(0).To String + "," + r.Item(1).ToString) <<--- and this line got a separator...so when my textbox append...it would be look Company_Name,Contact_number...example : OrmocNet,5707895 <<<--- so even if my code got concatinator it doesnt get it..and even if i use.......
    ("Select * from Company where Company_Name + "," + Contact_Number like '%"& textbox1.text &"%' " ,con) <<---this doesn't run...anyone have another way around?...pls help me..

  5. #5
    Joy4hacks's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Happy

    Question

    im done with autosuggest..the solution i find is to put a string splitter... but theres still something..like an event in a textbox..i want to check if the user click the suggestions or append the suggestions in a textbox?..anyone pls help me...




    you see google right?..when you search and click the suggested text ...it automatically search..without clicking the Search button...thats what I wanna do..
    Last edited by Joy4hacks; 02-21-2013 at 08:15 PM.

Similar Threads

  1. [Help Request] Need Help with RF016.REZ, RF017.REZ and RF123.REZ
    By zhanre in forum CrossFire PH Help
    Replies: 2
    Last Post: 06-22-2012, 12:04 AM
  2. [Help Request] I need help using MH walker!
    By manfishpig in forum Vindictus Help
    Replies: 3
    Last Post: 03-12-2012, 11:22 AM
  3. [Solved] Need help using Godmode and 1 Hit Kill v6.7 [NA | EU] [BindFix]
    By Aɴᴏɴʏᴍᴏᴜs Ԍᴀᴍᴇᴙ in forum Vindictus Help
    Replies: 5
    Last Post: 02-29-2012, 06:23 AM
  4. [Help Request] hello i need help PLEASE HELPPP i try all and with steam please tutorial
    By ermagedsar in forum Call of Duty Modern Warfare 3 Help
    Replies: 0
    Last Post: 02-11-2012, 06:52 AM
  5. [Solved] need Help using .dll's and injectors
    By ryansnipe007 in forum CrossFire Help
    Replies: 8
    Last Post: 08-06-2011, 02:36 PM