I have For/while loop that goes through the values in a list box and uses the Fill command to return the data row and display the appropriate columns on the linked components on a form.
It works fine on the first value but not on the second. If I reverse the values in the list box it still works on the 1st value so I know I have data in that matches in the database.
If I bind to a text box and execute the same Fill command it works just fine.
I can't figure out what I am doing wrong. Any ideas? I don't receive any errors it just blanks out all the objects on the form.
Dim
I As Long
Dim SerialNum As String
For I = 0 To lbSerialNumber.Items.Count - 1
SerialNum = lbSerialNumber.Items.Item(I).ToString
txtSerialNumber.Text = SerialNum
lbSerialNumber.SelectedIndex = I
Dim MyTableAdapter As New DataSet2TableAdapters.FINALS_DATATableAdapter
MyTableAdapter.Fill(DataSet2.FINALS_DATA, SerialNum)
'TODO: This line of code loads data into the 'DataSet2.GAGE' table. You can move, or remove it, as needed.
Me.GAGETableAdapter.Fill(Me.DataSet2.GAGE)
'TODO: This line of code loads data into the 'DataSet2.LOADCELL_SPECS' table. You can move, or remove it, as needed.
Me.LOADCELL_SPECSTableAdapter.Fill(Me.DataSet2.LOADCELL_SPECS)
'TODO: This line of code loads data into the 'DataSet2.MODELS' table. You can move, or remove it, as needed.
Me.MODELSTableAdapter.Fill(Me.DataSet2.MODELS)
' additional code to print a certificate in Word follows
Next I