This one has me stumped. I feel like it is something really simple, but I can't figure it out.
I have a combobox that is triggering the population of some checkboxes depending on the user mode. For some reason, when I put a MsgBox() at the beginning of the function, it works fine. But without that MsgBox(), I get the error that there is no row at position 0.
Anyone have any ideas?
MsgBox("value changed") '<---- this is the box that clears the error
'display the name once the number has been selected
Me.lblAssocName.Text = Me.cmbAssocID.SelectedValue.ToString
Try
'populate a table with that associate's information
Dim tblassoc As New DataSet1.assocStatusDataTable
Me.AssocStatusTableAdapter.FillByAssocID(tblassoc, Convert.ToString(Me.cmbAssocID.SelectedText))
'set the information of the associate dependent on the mode
'setting the associate's status...
If Me.btnAssocStatus.BackColor = Color.Green Then
If tblassoc.Rows(0).Item("groupleader") = True Then '<-- this is where
' error occurs.
Me.chkTeamLead.Checked = True
Else
Me.chkTeamLead.Checked = False
End If
If tblassoc.Rows(0).Item("status") = True Then
Me.chkActive.Checked = True
Else
Me.chkActive.Checked = False
End If
End If
End Sub