dollarbillg
Programmer
At the end of the second loop the Catch says that there are no rows at position 15. There are only 14 rows in that table and I am aware of that. What I attended on happening was that it would loop thru the rows and when the condition wasn't met to display the CodeItem2 form.
************************************************************Here's the code:
If Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count > 0 Then
'show the CodeItem form if the RIN has been coded
'for assessment
Try
Dim x As Integer
Dim i As Integer
Do Until x = Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count
x += 1
If Me.ConfigurationList1.T2_WORKING_AUX.Item(x).CONFIG_ID = CType(Me.xConfigID.Text.ToString, Integer) Then
ShowLookupForm(AddAProblem)
End If
Loop
Do Until i = Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count
i += 1
If Me.ConfigurationList1.T2_WORKING_AUX.Item(x).CONFIG_ID <> CType(Me.xConfigID.Text.ToString, Integer) Then
ShowLookupForm(CodeItem2)
Else
End If
Loop
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End IF
***********************************************************
Thanks dollarbillg
************************************************************Here's the code:
If Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count > 0 Then
'show the CodeItem form if the RIN has been coded
'for assessment
Try
Dim x As Integer
Dim i As Integer
Do Until x = Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count
x += 1
If Me.ConfigurationList1.T2_WORKING_AUX.Item(x).CONFIG_ID = CType(Me.xConfigID.Text.ToString, Integer) Then
ShowLookupForm(AddAProblem)
End If
Loop
Do Until i = Me.ConfigurationList1.T2_WORKING_AUX.Rows.Count
i += 1
If Me.ConfigurationList1.T2_WORKING_AUX.Item(x).CONFIG_ID <> CType(Me.xConfigID.Text.ToString, Integer) Then
ShowLookupForm(CodeItem2)
Else
End If
Loop
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End IF
***********************************************************
Thanks dollarbillg