⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmworcl.frm

📁 学院MIS管理系统,适合大部分毕业生,请大家支持
💻 FRM
📖 第 1 页 / 共 2 页
字号:
        Combo2.SetFocus
        Exit Sub
       Else
        dd(3) = True
        If (dd(0) Or dd(1) Or dd(2)) Then
        '组合查询语句
         txtSQL = txtSQL & " and xueqi ='" & Combo2.Text & "'"
        Else
         txtSQL = txtSQL & " xueqi ='" & Combo2.Text & "'"
        End If
       End If
    End If
    If (dd(0) Or dd(1)) Then
        Command1.Enabled = True
        Else
        Command1.Enabled = False
        End If
  '判断是否设置查询方式
  If Not (dd(0) Or dd(1) Or dd(2) Or dd(3)) Then
     txtSQL = "select * from gongzuoliang"
     txtSQL = txtSQL & " order by personnel_id "
    '执行查询语句
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    '将查询内容显示在表格控件中
    With myflexgrid
     .Rows = 1
     .CellAlignment = 4
     .TextMatrix(0, 0) = "教师编号"
     .TextMatrix(0, 1) = "姓    名"
     .TextMatrix(0, 2) = "课 程 名"
     .TextMatrix(0, 3) = "班    级 "
     .TextMatrix(0, 4) = "课时数"
     .TextMatrix(0, 5) = "学   年"
     .TextMatrix(0, 6) = "学   期"
     .TextMatrix(0, 7) = "人   数"
     '判断是否移动到数据集对象的最后一条记录
     Do While Not mrc.EOF
        .Rows = .Rows + 1
        .CellAlignment = 4
        .TextMatrix(.Rows - 1, 0) = mrc.Fields(0)
        .TextMatrix(.Rows - 1, 1) = mrc.Fields(1)
        .TextMatrix(.Rows - 1, 2) = mrc.Fields(2)
        .TextMatrix(.Rows - 1, 3) = mrc.Fields(3)
        .TextMatrix(.Rows - 1, 4) = mrc.Fields(4)
        .TextMatrix(.Rows - 1, 5) = mrc.Fields(5)
        .TextMatrix(.Rows - 1, 6) = mrc.Fields(6)
        .TextMatrix(.Rows - 1, 7) = mrc.Fields(7)
        mrc.MoveNext
    Loop
    End With
     '关闭数据集
     mrc.Close
    Exit Sub
  End If
  '查询所有满足条件的内容
     txtSQL = txtSQL & " order by personnel_id "
    '执行查询语句
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    '将查询内容显示在表格控件中
    With myflexgrid
     .Rows = 1
     .CellAlignment = 4
     .TextMatrix(0, 0) = "教师编号"
     .TextMatrix(0, 1) = "姓    名"
     .TextMatrix(0, 2) = "课 程 名"
     .TextMatrix(0, 3) = "班    级 "
     .TextMatrix(0, 4) = "课时数"
     .TextMatrix(0, 5) = "学   年"
     .TextMatrix(0, 6) = "学   期"
     .TextMatrix(0, 7) = "人   数"
     '判断是否移动到数据集对象的最后一条记录
     Do While Not mrc.EOF
        .Rows = .Rows + 1
        .CellAlignment = 4
        .TextMatrix(.Rows - 1, 0) = mrc.Fields(0)
        .TextMatrix(.Rows - 1, 1) = mrc.Fields(1)
        .TextMatrix(.Rows - 1, 2) = mrc.Fields(2)
        .TextMatrix(.Rows - 1, 3) = mrc.Fields(3)
        .TextMatrix(.Rows - 1, 4) = mrc.Fields(4)
        .TextMatrix(.Rows - 1, 5) = mrc.Fields(5)
        .TextMatrix(.Rows - 1, 6) = mrc.Fields(6)
        .TextMatrix(.Rows - 1, 7) = mrc.Fields(7)
        '移动到下一条记录
        If (dd(0) Or dd(1)) Then
        '给workfind添加数据
        workf.AddNew
        workf.Fields(0) = mrc.Fields(0)
        workf.Fields(1) = mrc.Fields(1)
        workf.Fields(2) = mrc.Fields(2)
        workf.Fields(3) = mrc.Fields(3)
        workf.Fields(4) = mrc.Fields(4)
        workf.Fields(5) = mrc.Fields(5)
        workf.Fields(6) = mrc.Fields(6)
        workf.Fields(7) = mrc.Fields(7)
        workf.MoveNext
        End If
        mrc.MoveNext
    Loop
End With
'关闭数据集
workf.Close
mrc.Close
End Sub
'从临时表中调出数据,打印报表
Private Sub Command1_Click()
Dim man As ADODB.Recordset
Dim tx As String
Dim rwork As String
Dim workf As ADODB.Recordset
Dim person As ADODB.Recordset
Dim numpf As Integer
Dim keshi As Integer
rwork = "select * from workfind"
Set workf = ExecuteSQL(rwork, tx)
 numpf = 0
 keshi = 0
 '没有记录时不许打印
 If workf.EOF Then
    sMeg = "无记录不可打印!"
    MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
    Exit Sub
 Else
    workf.MoveFirst
    Do While Not workf.EOF
        numpf = numpf + 1
        keshi = keshi + Trim(workf.Fields(4))
        '移动到下一条记录
        workf.MoveNext
    Loop
    workf.Close
End If
  If (Check1(0).value And Testtxt(txtbh)) Then
   rwork = "select * from personnel_infor where personnel_id='" & txtbh.Text & "'"
  End If
  If (Check1(1).value And Testtxt(txtName)) Then
  rwork = "select * from personnel_infor where name='" & txtName.Text & "'"
  End If
Set person = ExecuteSQL(rwork, tx)
drworkfind.Show
drworkfind.Sections(2).Controls("label1").Caption = "查询到" & numpf & "条记录"
drworkfind.Sections(2).Controls("label22").Caption = keshi
drworkfind.Sections(2).Controls("label2").Caption = Trim(person.Fields(10)) & "学院"
drworkfind.Sections(2).Controls("label3").Caption = Trim(person.Fields(6)) & "教研室"
drworkfind.Sections(2).Controls("label9").Caption = Trim(person.Fields(1))
drworkfind.Sections(2).Controls("label11").Caption = Trim(person.Fields(2))
drworkfind.Sections(2).Controls("label13").Caption = Trim(person.Fields(3))
drworkfind.Sections(2).Controls("label15").Caption = Trim(person.Fields(4))
End Sub
'初始化网格
Private Sub Form_Load()
     Dim txtSQL As String
     Dim MsgText As String
     Dim mrc As ADODB.Recordset
     Dim mrcc As ADODB.Recordset
     Command1.Enabled = False
With myflexgrid
     .ColWidth(0) = 1400
     .ColWidth(1) = 900
     .ColWidth(2) = 1800
     .ColWidth(3) = 1500
     .ColWidth(4) = 900
     .ColWidth(5) = 900
     .ColWidth(6) = 900
     .ColWidth(7) = 900
     .CellAlignment = 4
    .TextMatrix(0, 0) = "教师编号"
     .TextMatrix(0, 1) = "姓    名"
     .TextMatrix(0, 2) = "课 程 名"
     .TextMatrix(0, 3) = "班    级 "
     .TextMatrix(0, 4) = "课时数"
     .TextMatrix(0, 5) = "学   年"
     .TextMatrix(0, 6) = "学   期"
     .TextMatrix(0, 7) = "人   数"
  End With
     txtSQL = "select * from gongzuoliang"
     txtSQL = txtSQL & " order by personnel_id "
    '执行查询语句
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    '将查询内容显示在表格控件中
    With myflexgrid
     .Rows = 1
    .CellAlignment = 4
     .TextMatrix(0, 0) = "教师编号"
     .TextMatrix(0, 1) = "姓    名"
     .TextMatrix(0, 2) = "课 程 名"
     .TextMatrix(0, 3) = "班    级 "
     .TextMatrix(0, 4) = "课时数"
     .TextMatrix(0, 5) = "学   年"
     .TextMatrix(0, 6) = "学   期"
     .TextMatrix(0, 7) = "人   数"
     '判断是否移动到数据集对象的最后一条记录
     Do While Not mrc.EOF
        .Rows = .Rows + 1
        .CellAlignment = 4
        .TextMatrix(.Rows - 1, 0) = mrc.Fields(0)
        .TextMatrix(.Rows - 1, 1) = mrc.Fields(1)
        .TextMatrix(.Rows - 1, 2) = mrc.Fields(2)
        .TextMatrix(.Rows - 1, 3) = mrc.Fields(3)
        .TextMatrix(.Rows - 1, 4) = mrc.Fields(4)
        .TextMatrix(.Rows - 1, 5) = mrc.Fields(5)
        .TextMatrix(.Rows - 1, 6) = mrc.Fields(6)
        .TextMatrix(.Rows - 1, 7) = mrc.Fields(7)
        '移动到下一条记录
        mrc.MoveNext
    Loop
End With
'关闭数据集
mrc.Close
  '给下拉菜单赋值
    txtSQL = "select personnel_id ,name from personnel_infor"
    Set mrcc = ExecuteSQL(txtSQL, MsgText)
    If Not mrcc.EOF Then
    mrcc.MoveFirst
    Do While Not mrcc.EOF
         txtbh.AddItem Trim(mrcc.Fields(0))
         txtName.AddItem Trim(mrcc.Fields(1))
        '移动到下一条记录
        mrcc.MoveNext
    Loop
    End If
    mrcc.Close
End Sub
'清空临时工作量表“workfind”
Private Sub Form_Unload(Cancel As Integer)
Call intform
End Sub
Public Sub intform()
 Dim txs As String
 Dim man As String
 Dim rs As ADODB.Recordset
   txs = "delete from workfind"
   Set rs = ExecuteSQL(txs, man)
   
   
   'drworkfind.Show vbModal, Me
    Unload drworkfind
    Unload DataEnvironment1
     
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -