Results 1 to 11 of 11

Thread: [2005] Multiple Combo Boxes - same value

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    8

    [2005] Multiple Combo Boxes - same value

    I have multiple combo boxes (4 of them Shape 1, shape 2, etc.)) that are popultated by another combo box's data (Order Number). The fill fine, except for the fact that all of the 4 filled combo boxes show the exact same data no matter which one I change.

    [IMG]cbo.jpg[/IMG]

    Thanks,

    Vwalla
    Attached Images Attached Images  

  2. #2
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] Multiple Combo Boxes - same value

    There is a good chance that your event handling code handles the same code for all the combo boxes. You should post your even handling code for all four combo boxes.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    8

    Re: [2005] Multiple Combo Boxes - same value

    Is this what you are looking for? It is the combos with the Arrows "<------
    "
    Thanks

    VB Code:
    1. Friend WithEvents PWSDataSet As CastWorksheet.PWSDataSet
    2.     Friend WithEvents TBLPRECASTENTRYBindingSource As System.Windows.Forms.BindingSource
    3.     Friend WithEvents TBLPRECASTENTRYTableAdapter As CastWorksheet.PWSDataSetTableAdapters.TBLPRECASTENTRYTableAdapter
    4.     Friend WithEvents TBLPRECASTENTRYBindingNavigator As System.Windows.Forms.BindingNavigator
    5.     Friend WithEvents BindingNavigatorAddNewItem As System.Windows.Forms.ToolStripButton
    6.     Friend WithEvents BindingNavigatorCountItem As System.Windows.Forms.ToolStripLabel
    7.     Friend WithEvents BindingNavigatorDeleteItem As System.Windows.Forms.ToolStripButton
    8.     Friend WithEvents BindingNavigatorMoveFirstItem As System.Windows.Forms.ToolStripButton
    9.     Friend WithEvents BindingNavigatorMovePreviousItem As System.Windows.Forms.ToolStripButton
    10.     Friend WithEvents BindingNavigatorSeparator As System.Windows.Forms.ToolStripSeparator
    11.     Friend WithEvents BindingNavigatorPositionItem As System.Windows.Forms.ToolStripTextBox
    12.     Friend WithEvents BindingNavigatorSeparator1 As System.Windows.Forms.ToolStripSeparator
    13.     Friend WithEvents BindingNavigatorMoveNextItem As System.Windows.Forms.ToolStripButton
    14.     Friend WithEvents BindingNavigatorMoveLastItem As System.Windows.Forms.ToolStripButton
    15.     Friend WithEvents BindingNavigatorSeparator2 As System.Windows.Forms.ToolStripSeparator
    16.     Friend WithEvents TBLPRECASTENTRYBindingNavigatorSaveItem As System.Windows.Forms.ToolStripButton
    17.     Friend WithEvents SplitContainer1 As System.Windows.Forms.SplitContainer
    18.     Friend WithEvents WKOrdBindingSource As System.Windows.Forms.BindingSource
    19.     Friend WithEvents WKOrdTableAdapter As CastWorksheet.PWSDataSetTableAdapters.WKOrdTableAdapter
    20.     Friend WithEvents TBLMATERIALBindingSource As System.Windows.Forms.BindingSource
    21.     Friend WithEvents TBLMATERIALTableAdapter As CastWorksheet.PWSDataSetTableAdapters.TBLMATERIALTableAdapter
    22.     Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
    23.     Friend WithEvents ORDERNODataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    24.     Friend WithEvents CASTENTRYDATE As System.Windows.Forms.DataGridViewTextBoxColumn
    25.     Friend WithEvents NewToolStripButton As System.Windows.Forms.ToolStripSeparator
    26.     Friend WithEvents PrintToolStripButton As System.Windows.Forms.ToolStripButton
    27.     Friend WithEvents toolStripSeparator As System.Windows.Forms.ToolStripSeparator
    28.     Friend WithEvents HelpToolStripButton As System.Windows.Forms.ToolStripButton
    29.     Friend WithEvents TblmaterialTableAdapter1 As CastWorksheet.PWSDataSetTableAdapters.TBLMATERIALTableAdapter
    30.     Friend WithEvents SplitContainer2 As System.Windows.Forms.SplitContainer
    31.     Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    32.     Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
    33.     Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
    34.     Friend WithEvents CASTENTRYDATETextBox As System.Windows.Forms.TextBox
    35.     Friend WithEvents CASTIDTextBox As System.Windows.Forms.TextBox
    36.     Friend WithEvents TabPage4 As System.Windows.Forms.TabPage
    37.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    38.     Friend WithEvents ORDERNOComboBox As System.Windows.Forms.ComboBox
    39.     Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
    40.     Friend WithEvents QTY_MATL_2TextBox As System.Windows.Forms.TextBox
    41.     Friend WithEvents BAG_SIZEL_2TextBox As System.Windows.Forms.TextBox
    42.     Friend WithEvents QTY_MATL_1TextBox As System.Windows.Forms.TextBox
    43.     Friend WithEvents BAG_SIZEL_1TextBox As System.Windows.Forms.TextBox
    44.     Friend WithEvents NEEDLEQTYTextBox As System.Windows.Forms.TextBox
    45.     Friend WithEvents NEEDLETYPEComboBox As System.Windows.Forms.ComboBox
    46.     Friend WithEvents BATCHNOTextBox As System.Windows.Forms.TextBox
    47.     Friend WithEvents MATERIALComboBox As System.Windows.Forms.ComboBox
    48.     Friend WithEvents Label1 As System.Windows.Forms.Label
    49.     Friend WithEvents SHAPE_4ComboBox As System.Windows.Forms.ComboBox  <------
    50.     Friend WithEvents SHAPE_3ComboBox As System.Windows.Forms.ComboBox  <------
    51.     Friend WithEvents SHAPE_2ComboBox As System.Windows.Forms.ComboBox  <------
    52.     Friend WithEvents SHAPE_1ComboBox As System.Windows.Forms.ComboBox  <------
    53.     Friend WithEvents Label2 As System.Windows.Forms.Label
    54.     Friend WithEvents TIME_DAY_AMPMComboBox As System.Windows.Forms.ComboBox
    55.     Friend WithEvents TIME_DAY_MINComboBox As System.Windows.Forms.ComboBox
    56.     Friend WithEvents TIME_DAY_HRComboBox As System.Windows.Forms.ComboBox
    57.     Friend WithEvents TEMP_AMBIENTTextBox As System.Windows.Forms.TextBox
    58.     Friend WithEvents TEMP_DRYTextBox As System.Windows.Forms.TextBox
    59.     Friend WithEvents MH_MISCTextBox As System.Windows.Forms.TextBox
    60.     Friend WithEvents MH_PREPTextBox As System.Windows.Forms.TextBox
    61.     Friend WithEvents MH_POURTextBox As System.Windows.Forms.TextBox
    62.     Friend WithEvents Label4 As System.Windows.Forms.Label
    63.     Friend WithEvents TIME_VIBE_MINTextBox As System.Windows.Forms.TextBox
    64.     Friend WithEvents TIME_MIX_MINTextBox As System.Windows.Forms.TextBox
    65.     Friend WithEvents TEMP_MIXTextBox As System.Windows.Forms.TextBox
    66.     Friend WithEvents TEMP_WATERTextBox As System.Windows.Forms.TextBox
    67.     Friend WithEvents WATER_PINTSTextBox As System.Windows.Forms.TextBox
    68.     Friend WithEvents WATER_GALLONSTextBox As System.Windows.Forms.TextBox
    69.     Friend WithEvents Label3 As System.Windows.Forms.Label
    70.     Friend WithEvents PRECASTNOTESTextBox As System.Windows.Forms.TextBox
    71.     Friend WithEvents ProductTableBindingSource As System.Windows.Forms.BindingSource
    72.     Friend WithEvents ProductTableTableAdapter As CastWorksheet.PWSDataSetTableAdapters.ProductTableTableAdapter

  4. #4
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] Multiple Combo Boxes - same value

    Actually I meant the event code. The code that changes the values of the combo boxes (and perferablly any events that handle the events of the combobox events like ComboBox1_Click, etc.).
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    8

    Re: [2005] Multiple Combo Boxes - same value

    Sorry-

    Here is the code for the whole form...it's short. No event handling on the combo's except fot the order number. The ProductTableTableAdapter fills the 4 combos based on the value in the ORDERNOComboBox.

    VB Code:
    1. Public Class frmCastSheet
    2.  
    3.     Private Sub TBLPRECASTENTRYBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    4.         Me.Validate()
    5.         Me.TBLPRECASTENTRYBindingSource.EndEdit()
    6.         Me.TBLPRECASTENTRYTableAdapter.Update(Me.PWSDataSet.TBLPRECASTENTRY)
    7.  
    8.     End Sub
    9.  
    10.  
    11.     Private Sub TBLPRECASTENTRYBindingNavigatorSaveItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TBLPRECASTENTRYBindingNavigatorSaveItem.Click
    12.         Me.Validate()
    13.         Me.CASTENTRYDATETextBox.Text = Now()
    14.         Me.TBLPRECASTENTRYBindingSource.EndEdit()
    15.         Me.TBLPRECASTENTRYTableAdapter.Update(Me.PWSDataSet.TBLPRECASTENTRY)
    16.  
    17.  
    18.     End Sub
    19.  
    20.     Private Sub frmCastSheet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    21.         Me.TBLPRECASTENTRYTableAdapter.Fill(Me.PWSDataSet.TBLPRECASTENTRY)
    22.         Me.TBLMATERIALTableAdapter.Fill(Me.PWSDataSet.TBLMATERIAL)
    23.         'Me.WKOrdTableAdapter.Fill(Me.PWSDataSet.WKOrd)
    24.         Me.PWSDataSet.EnforceConstraints = False
    25.         Me.WKOrdTableAdapter.FillByDistinctOrder(Me.PWSDataSet.WKOrd)
    26.  
    27.     End Sub
    28.  
    29.     Private Sub PrintToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripButton.Click
    30.         CastReportList.Show()
    31.     End Sub
    32.  
    33.     Private Sub ORDERNOComboBox_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ORDERNOComboBox.SelectedValueChanged
    34.         Me.ProductTableTableAdapter.Fill(Me.PWSDataSet.ProductTable, Me.ORDERNOComboBox.Text)
    35.  
    36.     End Sub
    37.  
    38. End Class

  6. #6
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] Multiple Combo Boxes - same value

    I'm not sure how the combo boxes can all be cahnging at the same time if you don't even have any code to fill the combo boxes or to handle events for those combo boxes. Where is the code to fill the combo boxes?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    8

    Re: [2005] Multiple Combo Boxes - same value

    There is code to fill them using the reduced code format. See this code below.

    VB Code:
    1. 'SHAPE_4ComboBox
    2.         '
    3.         Me.SHAPE_4ComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBLPRECASTENTRYBindingSource, "SHAPE_4", True))
    4.         Me.SHAPE_4ComboBox.DataSource = Me.ProductTableBindingSource
    5.         Me.SHAPE_4ComboBox.DisplayMember = "ProductID"
    6.         Me.SHAPE_4ComboBox.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    7.         Me.SHAPE_4ComboBox.ForeColor = System.Drawing.Color.Blue
    8.         Me.SHAPE_4ComboBox.FormattingEnabled = True
    9.         Me.SHAPE_4ComboBox.Location = New System.Drawing.Point(368, 244)
    10.         Me.SHAPE_4ComboBox.Name = "SHAPE_4ComboBox"
    11.         Me.SHAPE_4ComboBox.Size = New System.Drawing.Size(164, 21)
    12.         Me.SHAPE_4ComboBox.TabIndex = 23
    13.         Me.SHAPE_4ComboBox.ValueMember = "ProductID"
    14.         '
    15.         'ProductTableBindingSource
    16.         '
    17.         Me.ProductTableBindingSource.DataMember = "ProductTable"
    18.         Me.ProductTableBindingSource.DataSource = Me.PWSDataSet
    19.         '
    20.         'SHAPE_3ComboBox
    21.         '
    22.         Me.SHAPE_3ComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBLPRECASTENTRYBindingSource, "SHAPE_3", True))
    23.         Me.SHAPE_3ComboBox.DataSource = Me.ProductTableBindingSource
    24.         Me.SHAPE_3ComboBox.DisplayMember = "ProductID"
    25.         Me.SHAPE_3ComboBox.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    26.         Me.SHAPE_3ComboBox.ForeColor = System.Drawing.Color.Blue
    27.         Me.SHAPE_3ComboBox.FormattingEnabled = True
    28.         Me.SHAPE_3ComboBox.Location = New System.Drawing.Point(94, 244)
    29.         Me.SHAPE_3ComboBox.Name = "SHAPE_3ComboBox"
    30.         Me.SHAPE_3ComboBox.Size = New System.Drawing.Size(164, 21)
    31.         Me.SHAPE_3ComboBox.TabIndex = 21
    32.         Me.SHAPE_3ComboBox.ValueMember = "ProductID"
    33.         '
    34.         'SHAPE_2ComboBox
    35.         '
    36.         Me.SHAPE_2ComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBLPRECASTENTRYBindingSource, "SHAPE_2", True))
    37.         Me.SHAPE_2ComboBox.DataSource = Me.ProductTableBindingSource
    38.         Me.SHAPE_2ComboBox.DisplayMember = "ProductID"
    39.         Me.SHAPE_2ComboBox.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    40.         Me.SHAPE_2ComboBox.ForeColor = System.Drawing.Color.Blue
    41.         Me.SHAPE_2ComboBox.FormattingEnabled = True
    42.         Me.SHAPE_2ComboBox.Location = New System.Drawing.Point(368, 217)
    43.         Me.SHAPE_2ComboBox.Name = "SHAPE_2ComboBox"
    44.         Me.SHAPE_2ComboBox.Size = New System.Drawing.Size(164, 21)
    45.         Me.SHAPE_2ComboBox.TabIndex = 19
    46.         Me.SHAPE_2ComboBox.ValueMember = "ProductID"
    47.         '
    48.         'SHAPE_1ComboBox
    49.         '
    50.         Me.SHAPE_1ComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBLPRECASTENTRYBindingSource, "SHAPE_1", True))
    51.         Me.SHAPE_1ComboBox.DataSource = Me.ProductTableBindingSource
    52.         Me.SHAPE_1ComboBox.DisplayMember = "ProductID"
    53.         Me.SHAPE_1ComboBox.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    54.         Me.SHAPE_1ComboBox.ForeColor = System.Drawing.Color.Blue
    55.         Me.SHAPE_1ComboBox.FormattingEnabled = True
    56.         Me.SHAPE_1ComboBox.Location = New System.Drawing.Point(94, 217)
    57.         Me.SHAPE_1ComboBox.Name = "SHAPE_1ComboBox"
    58.         Me.SHAPE_1ComboBox.Size = New System.Drawing.Size(164, 21)
    59.         Me.SHAPE_1ComboBox.TabIndex = 17
    60.         Me.SHAPE_1ComboBox.ValueMember = "ProductID"

  8. #8
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] Multiple Combo Boxes - same value

    Hmmm. I don't really see anything there. Could you ******** the problem a little more for me? Are you saying that when you pick a new item in the combo box, all of them automatically change to that same item?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    8

    Re: [2005] Multiple Combo Boxes - same value

    Yes. They are all off of the same dataset, so I think that therein lies the problem.

    I got some answers from a different forum.

    http://www.vbcity.com/forums/topic.asp?tid=124849

    Thanks for the help.

    V

  10. #10
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] Multiple Combo Boxes - same value

    Sorry we couldn't be of more help.

    Don't forget to mark you thread resolved (Thread Tools Menu at top for forums).

    Good luck.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  11. #11
    Addicted Member Pythagoras's Avatar
    Join Date
    Feb 2005
    Location
    Greece
    Posts
    137

    Re: [2005] Multiple Combo Boxes - same value

    There all bound to the same datasource, and in when the event fires your just refilling the dataset. So the value of all the comboboxes just goes to the first record in your dataset.
    Visual Studio.Net 2003

    "Every man has been made by God in order to acquire knowledge and contemplate."
    --Pythagoras

Posting Permissions

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



Click Here to Expand Forum to Full Width