Private Sub edtSearchName_TextChanged (Old As String, New As String)
    Dim rs As ResultSet
    rs = Starter.sqlPlayers.ExecQuery2("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS where PlayerName like ? ORDER BY GEN DESC", Array As String($"%${ New }%"$))
    fill_clv (rs)
    rs.Close
End Sub
Private Sub edtSearchGen_TextChanged (Old As String, New As String)
    Dim rs As ResultSet
    rs = Starter.sqlPlayers.ExecQuery2("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE GEN like ? ", Array As String($"${ New }"$))
    fill_clv (rs)
    rs.Close
    If New = "" Then
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
        fill_clv (rs)
        rs.Close
    End If
End Sub
Private Sub spnTeam_ItemClick (Position As Int, Value As Object)
    Dim rs As ResultSet
    rs = Starter.sqlPlayers.ExecQuery2("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Team like ? ORDER BY GEN DESC", Array As String($"${ Value }"$))
    If Position = 0 Then
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
    End If
    fill_clv (rs)
    rs.Close
End Sub
Private Sub cbxG_CheckedChange(Checked As Boolean)
    Dim rs As ResultSet
    If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
    End If
    fill_clv (rs)
    rs.Close
End Sub
Private Sub cbxF_CheckedChange(Checked As Boolean)
    Dim rs As ResultSet
    If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
    End If
    fill_clv (rs)
    rs.Close
End Sub
Private Sub cbxC_CheckedChange(Checked As Boolean)
    Dim rs As ResultSet
    If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' Or Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else If cbxG.Checked=True And cbxF.Checked=False And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='G' OR Pos2='G' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=True And cbxC.Checked=False Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='F' OR Pos2='F' ORDER BY GEN DESC")
    Else If cbxG.Checked=False And cbxF.Checked=False And cbxC.Checked=True Then
        rs = Starter.sqlPlayers.ExecQuery("Select ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS WHERE Pos1='C' OR Pos2='C' ORDER BY GEN DESC")
        
    Else
        rs = Starter.sqlPlayers.ExecQuery("SELECT ID, PlayerName, Pos1, Pos2, Team, GEN from PLAYERS ORDER BY GEN DESC")
    End If
    fill_clv (rs)
    rs.Close
End Sub