1 Replies - 394 Views - Last Post: 21 January 2014 - 06:00 PM Rate Topic: -----

#1 IshamIce  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 21-January 14

Combobox Click

Posted 21 January 2014 - 02:21 AM

'Connect to database
CN.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=I:\PicView1.accdb"
CN.Open()

'Execute SQL
CMD.Connection = CN

If ComboBox1.Text = "" Then
CMD.CommandText = "SELECT Album_Name FROM PicView ORDER by Album_Name"
Else
CMD.CommandText = "SELECT Album_Name FROM PicView WHERE Album_Name like '%" & ComboBox1.Text & "%'"
End If

RD = CMD.ExecuteReader()

While RD.Read

ComboBox1.Items.Add(RD("Album_Name"))

End While



Now Currently doing a wildcard , how do i add in the function so that when i click the specific word , the object will appear in my application?

Is This A Good Question/Topic? 0
  • +

Replies To: Combobox Click

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4437
  • View blog
  • Posts: 12,308
  • Joined: 18-April 07

Re: Combobox Click

Posted 21 January 2014 - 06:00 PM

Check out a few properties of the combobox control, selectedvalue, selectedItem and selectedIndex. These three properties can be used to fetch the item that is currently selected in the combobox and return the value of it which you can then use in your select instead of the wildcard.

More info:

http://msdn.microsof...(v=vs.110).aspx

I hope that is what you are asking about. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1