Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a basic windows form in VB. I am using the following code to connect to a SQL database. The database has two tables. The goal here is have a user make a selection in one combo box and populate the other with only the records that match the query. The first combobox is populated by table tblsymbols column process. The second is populated by tblparts and should fill the box with all part numbers where the process columns match.

 

Private Sub frmParts_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

Me.TblPartsTableAdapter.Fill(Me.KanbanDataSet.tblParts)

 

Me.TblSymbolsTableAdapter.Fill(Me.KanbanDataSet.tblSymbols)

Dim sqlprocess As String = Nothing

sqlprocess = "SELECT * from tblSymbols"

cboprocess.DataSource = KanbanDataSet.Tables(1)

cboprocess.ValueMember = "Process"

cboprocess.SelectedValue = -1

 

 

End Sub

 

Private Sub ProcessComboBox_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cboprocess.SelectedIndexChanged

 

Dim strprocess As String = cboprocess.Text

Dim strpart = "SELECT PartNumber FROM tblParts WHERE Process = strprocess"

 

End Sub

 

Any help would be great.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...