Private Sub C删除_Click()

If C删除.Caption = "删除" Then
    If Cell1.DoGetCurrentRow < 2 Then Exit Sub

    C插入.Enabled = False
    C修改.Enabled = False
    C删除.Caption = "删除确定"
    C返回.Caption = "取消"
    CurrentRow = Cell1.DoGetCurrentRow
    
    Cell1.DoSetCell3DState 0, CurrentRow, 2
    Cell1.DoSetCell3DState 1, CurrentRow, 2
    Cell1.DoSetCell3DState 2, CurrentRow, 2
    Cell1.DoSetCell3DState 3, CurrentRow, 2
    Cell1.DoSetCell3DState 4, CurrentRow, 2
    Cell1.DoRedrawRange 0, CurrentRow, 4, CurrentRow

Else
    txtSQL = "delete from 系部信息表 where 编号= '" & Trim(fGetCellString(0, CurrentRow, Cell1)) & "'"
    Call ExecuteSQL(txtSQL, msg_Sql)
    If Left(msg_Sql, 4) = "查询错误" Then
        MsgBox msg_Sql, vbCritical, "错误信息"
        Exit Sub
    End If


    Cell1.DoDeleteRow CurrentRow, 1
    C插入.Enabled = True
    C修改.Enabled = True
    C删除.Caption = "删除"
    C返回.Caption = "返回"
End If

End Sub

