年级限制表.frm

来自「智能排课系统」· FRM 代码 · 共 1,529 行 · 第 1/4 页

FRM
1,529
字号
End If
If Chk52.Value = 1 Then
    rstmajorcourse.edit
    rstmajorcourse.Fields("52") = "a"
    rstmajorcourse.Update
Else
    rstmajorcourse.edit
    rstmajorcourse.Fields("52") = "1"
    rstmajorcourse.Update
End If
If Chk53.Value = 1 Then
    rstmajorcourse.edit
    rstmajorcourse.Fields("53") = "a"
    rstmajorcourse.Update
Else
    rstmajorcourse.edit
    rstmajorcourse.Fields("53") = "1"
    rstmajorcourse.Update
End If
If Chk54.Value = 1 Then
    rstmajorcourse.edit
    rstmajorcourse.Fields("54") = "a"
    rstmajorcourse.Update
Else
    rstmajorcourse.edit
    rstmajorcourse.Fields("54") = "1"
    rstmajorcourse.Update
End If
Set rstclass = db.OpenRecordset("select * from class")
rstclass.Filter = "majorid='" & rstmajorcourse.Fields("majorid") & "'"
Set rstclass = rstclass.OpenRecordset()
If rstclass.RecordCount() <> 0 Then
  rstclass.MoveFirst
  Do Until rstclass.EOF
     Set rstclasscourse = dbcourse.OpenRecordset("select * from courseclass")
     rstclasscourse.Filter = "classid='" & rstclass.Fields("classid") & "'"
     Set rstclasscourse = rstclasscourse.OpenRecordset()
     If Chk11.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("11") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("11") = "1"
        rstclasscourse.Update
    End If
    If chk12.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("12") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("12") = "1"
        rstclasscourse.Update
    End If
    If Chk13.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("13") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("13") = "1"
        rstclasscourse.Update
    End If
    If Chk14.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("14") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("14") = "1"
        rstclasscourse.Update
    End If
    If Chk21.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("21") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("21") = "1"
        rstclasscourse.Update
    End If
    If Chk22.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("22") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("22") = "1"
        rstclasscourse.Update
    End If
    If Chk23.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("23") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("23") = "1"
        rstclasscourse.Update
    End If
    If Chk24.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("24") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("24") = "1"
        rstclasscourse.Update
    End If
    If Chk31.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("31") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("31") = "1"
        rstclasscourse.Update
    End If
    If Chk32.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("32") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("32") = "1"
        rstclasscourse.Update
    End If
    If Chk33.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("33") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("33") = "1"
        rstclasscourse.Update
    End If
    If Chk34.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("34") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("34") = "1"
        rstclasscourse.Update
    End If
    If Chk41.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("41") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("41") = "1"
        rstclasscourse.Update
    End If
    If Chk42.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("42") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("42") = "1"
        rstclasscourse.Update
    End If
    If Chk43.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("43") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("43") = "1"
        rstclasscourse.Update
    End If
    If Chk44.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("44") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("44") = "1"
        rstclasscourse.Update
    End If
    If Chk51.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("51") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("51") = "1"
        rstclasscourse.Update
    End If
    If Chk52.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("52") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("52") = "1"
        rstclasscourse.Update
    End If
    If Chk53.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("53") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
        rstclasscourse.Fields("53") = "1"
        rstclasscourse.Update
    End If
    If Chk54.Value = 1 Then
        rstclasscourse.edit
        rstclasscourse.Fields("54") = "a"
        rstclasscourse.Update
    Else
        rstclasscourse.edit
         rstclasscourse.Fields("54") = "1"
        rstclasscourse.Update
    End If
    rstclass.MoveNext
    Loop
End If
rstmajor.MoveNext
Loop
Label2.Caption = "数据处理完成!"

End Sub





Private Sub Cmdexit_Click()
dbcourse.Close
Unload Me
frmmain.Show vbModal

End Sub




Private Sub Form_Load()
Set dbcourse = DBEngine.Workspaces(0).OpenDatabase("d:\coursetable.mdb")
Set db = DBEngine.Workspaces(0).OpenDatabase("d:\basic.mdb")

txtgrade.Text = ""
Chk11.Value = 0
chk12.Value = 0
Chk13.Value = 0
Chk14.Value = 0
Chk21.Value = 0
Chk22.Value = 0
Chk23.Value = 0
Chk24.Value = 0
Chk31.Value = 0
Chk32.Value = 0
Chk33.Value = 0
Chk34.Value = 0
Chk41.Value = 0
Chk42.Value = 0
Chk43.Value = 0
Chk44.Value = 0
Chk51.Value = 0
Chk52.Value = 0
Chk53.Value = 0
Chk54.Value = 0

End Sub

Private Sub txtgrade_Change()

Set rstgradecourse = dbcourse.OpenRecordset("select * from coursegrade")
rstgradecourse.Filter = "gradeid='" & txtgrade.Text & "'"
Set rstgradecourse = rstgradecourse.OpenRecordset()
If rstgradecourse.RecordCount() <> 0 Then

    If rstgradecourse.Fields("11") = "a" Then
        Chk11.Value = 1
    Else
       Chk11.Value = 0
    End If
    If rstgradecourse.Fields("12") = "a" Then
       chk12.Value = 1
    Else
      chk12.Value = 0
    End If
    If rstgradecourse.Fields("13") = "a" Then
         Chk13.Value = 1
    Else
        Chk13.Value = 0
    End If
    If rstgradecourse.Fields("14") = "a" Then
         Chk14.Value = 1
    Else
        Chk14.Value = 0
    End If
    If rstgradecourse.Fields("21") = "a" Then
         Chk21.Value = 1
    Else
        Chk21.Value = 0
    End If
    If rstgradecourse.Fields("22") = "a" Then
         Chk22.Value = 1
    Else
        Chk22.Value = 0
    End If
    If rstgradecourse.Fields("23") = "a" Then
         Chk23.Value = 1
    Else
        Chk23.Value = 0
    End If
    If rstgradecourse.Fields("24") = "a" Then
         Chk24.Value = 1
    Else
        Chk24.Value = 0
    End If
    If rstgradecourse.Fields("31") = "a" Then
         Chk31.Value = 1
    Else
        Chk31.Value = 0
    End If
    If rstgradecourse.Fields("32") = "a" Then
         Chk32.Value = 1
    Else
        Chk32.Value = 0
    End If
    If rstgradecourse.Fields("33") = "a" Then
         Chk33.Value = 1
    Else
        Chk33.Value = 0
    End If
    If rstgradecourse.Fields("34") = "a" Then
         Chk34.Value = 1
    Else
        Chk34.Value = 0
    End If
    If rstgradecourse.Fields("41") = "a" Then
         Chk41.Value = 1
    Else
        Chk41.Value = 0
    End If
    If rstgradecourse.Fields("42") = "a" Then
         Chk42.Value = 1
    Else
        Chk42.Value = 0
    End If
    If rstgradecourse.Fields("43") = "a" Then
         Chk43.Value = 1
    Else
        Chk43.Value = 0
    End If
    If rstgradecourse.Fields("44") = "a" Then
         Chk44.Value = 1
    Else
        Chk44.Value = 0
    End If
    If rstgradecourse.Fields("51") = "a" Then
         Chk51.Value = 1
    Else
        Chk51.Value = 0
    End If
    If rstgradecourse.Fields("52") = "a" Then
         Chk52.Value = 1
    Else
        Chk52.Value = 0
    End If
    If rstgradecourse.Fields("53") = "a" Then
         Chk53.Value = 1
    Else
        Chk53.Value = 0
    End If
    If rstgradecourse.Fields("54") = "a" Then
        Chk54.Value = 1
    Else
        Chk54.Value = 0
    End If

End If
End Sub

⌨️ 快捷键说明

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