TennesseeFox
Programmer
Ive searched the site and the closest thing i've found was 796-742024, but it doesnt fully explain the fix for the problem.
Ive got a form created by the dataform wizard thats connected to a main table.
I've got a few combo boxes that were added that are bound to another table. The drop down list has values for eye color. Ive been able to populate the drop down with the correct info from eye_color table. My problem is when I open the form the data fills the combo boxes, some of the data is correct. The other boxes fill with the first item in the drop down list. I hit the forward record button then back button and the info in the dropdown is corrected. It only happens on the load proceedure of the form and displays the first item in the list.
here is the code created when I inserted the combo box:
Me.ComboBox1.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.objsubinf, "SubjectInfo.Eyes"))
Me.ComboBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.objsubinf, "SubjectInfo.Eyes"))
Me.ComboBox1.DataSource = Me.objsubinf.Eye_Color_Tbl
Me.ComboBox1.DisplayMember = "Eye_Color"
Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox1.Location = New System.Drawing.Point(160, 504)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.TabIndex = 15
Me.ComboBox1.ValueMember = "Eye_Color"
'
Does anyone have a fix for this? and why does this occur on a few combos and not the others on the same form(the aforementioned code is exactly the same, aside from the different tables)???
Thank you
Tennessee
Ive got a form created by the dataform wizard thats connected to a main table.
I've got a few combo boxes that were added that are bound to another table. The drop down list has values for eye color. Ive been able to populate the drop down with the correct info from eye_color table. My problem is when I open the form the data fills the combo boxes, some of the data is correct. The other boxes fill with the first item in the drop down list. I hit the forward record button then back button and the info in the dropdown is corrected. It only happens on the load proceedure of the form and displays the first item in the list.
here is the code created when I inserted the combo box:
Me.ComboBox1.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.objsubinf, "SubjectInfo.Eyes"))
Me.ComboBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.objsubinf, "SubjectInfo.Eyes"))
Me.ComboBox1.DataSource = Me.objsubinf.Eye_Color_Tbl
Me.ComboBox1.DisplayMember = "Eye_Color"
Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox1.Location = New System.Drawing.Point(160, 504)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.TabIndex = 15
Me.ComboBox1.ValueMember = "Eye_Color"
'
Does anyone have a fix for this? and why does this occur on a few combos and not the others on the same form(the aforementioned code is exactly the same, aside from the different tables)???
Thank you
Tennessee