|
-
Jun 14th, 2005, 01:19 PM
#1
Thread Starter
Lively Member
Here's a fun one...ToolTips, ListBoxes, DataSets..Oh MY! [RESOLVED,THIS BOARD ROCKS!]
One ListBox (customer) contains data from a database, another ListBox (part number) gets filled when an item in the customer ListBox is clicked (SelectedIndexChanged).
What I want to do, is display a ToolTip containing the Part Description (another field in the partdefinition table, which is already in the dataset) when hovering over the partnumber in the second ListBox.
Here's the event that puts the part numbers in the second ListBox based on the selected customer from the first:
VB Code:
Private Sub lbxRecCust_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbxRecCust.SelectedIndexChanged
'Dim srch As String
Dim sqlsrch As String
Dim dssrch As New DataSet
Dim dasrch As New Odbc.OdbcDataAdapter
Try
sqlsrch = "SELECT * FROM partdefinition WHERE LOWER(customername) LIKE '%" & CType(lbxRecCust.SelectedItem, DataRowView).Item("customername").ToString.ToLower & "%' ORDER BY partnumber ASC;"
dasrch = New Odbc.OdbcDataAdapter(sqlsrch, con)
dasrch.Fill(dssrch, "partdefinition")
Catch ox As Odbc.OdbcException
MsgBox(ox.Message)
Exit Sub
End Try
With lbxRecPart
.DataSource = dssrch.Tables("partdefinition")
.DisplayMember = "partnumber"
End With
'MessageBox.Show("There are no parts associated with this customer", "No Parts", MessageBoxButtons.OK)
End Sub
Last edited by milkmood; Jun 16th, 2005 at 11:12 AM.
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|