📄 教室限制窗体.frm
字号:
End
Begin VB.CheckBox Chk21
BackColor = &H00FFC0C0&
Caption = "周二第一节"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 300
Left = 360
TabIndex = 2
Top = 2130
Width = 1935
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1680
Top = 0
Visible = 0 'False
Width = 3015
_ExtentX = 5318
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\basic.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\basic.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select classroomid,classroomname from classroom"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "教室限制窗体.frx":0000
Height = 7335
Left = 10080
TabIndex = 15
Top = 1680
Width = 4935
_ExtentX = 8705
_ExtentY = 12938
_Version = 393216
AllowUpdate = -1 'True
ColumnHeaders = 0 'False
ForeColor = 12582912
HeadLines = 1
RowHeight = 27
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "教室名称与编号表"
ColumnCount = 2
BeginProperty Column00
DataField = "classroomid"
Caption = "教室编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "classroomname"
Caption = "教室名称"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1995.024
EndProperty
BeginProperty Column01
ColumnWidth = 4004.788
EndProperty
EndProperty
End
Begin VB.Label label1
BackStyle = 0 'Transparent
Caption = "教室编号:"
BeginProperty Font
Name = "Tahoma"
Size = 36
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 975
Left = 2280
TabIndex = 16
Top = 360
Width = 3855
End
End
Attribute VB_Name = "Frmclassroomlimit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As DAO.Database
Dim rstclassroom As DAO.Recordset
Option Explicit
Private Sub Cmdedit_Click()
On Error Resume Next
Set rstclassroom = db.OpenRecordset("select * from courseclassroom")
rstclassroom.Filter = "classroomid='" & Txtclassroomid.Text & "'"
Set rstclassroom = rstclassroom.OpenRecordset()
If Chk11.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("11") = "a"
rstclassroom.Update
End If
If Chk11.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("11") = "a"
rstclassroom.Update
End If
If Chk12.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("12") = "a"
rstclassroom.Update
End If
If Chk13.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("13") = "a"
rstclassroom.Update
End If
If Chk14.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("14") = "a"
rstclassroom.Update
End If
If Chk21.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("21") = "a"
rstclassroom.Update
End If
If Chk22.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("22") = "a"
rstclassroom.Update
End If
If Chk23.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("23") = "a"
rstclassroom.Update
End If
If Chk24.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("24") = "a"
rstclassroom.Update
End If
If Chk31.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("31") = "a"
rstclassroom.Update
End If
If Chk32.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("32") = "a"
rstclassroom.Update
End If
If Chk33.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("33") = "a"
rstclassroom.Update
End If
If Chk34.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("34") = "a"
rstclassroom.Update
End If
If Chk41.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("41") = "a"
rstclassroom.Update
End If
If Chk42.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("42") = "a"
rstclassroom.Update
End If
If Chk43.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("43") = "a"
rstclassroom.Update
End If
If Chk44.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("44") = "a"
rstclassroom.Update
End If
If Chk51.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("51") = "a"
rstclassroom.Update
End If
If Chk52.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("52") = "a"
rstclassroom.Update
End If
If Chk53.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("53") = "a"
rstclassroom.Update
End If
If Chk54.Value = 1 Then
rstclassroom.edit
rstclassroom.Fields("54") = "a"
rstclassroom.Update
End If
End Sub
Private Sub Cmdelete_Click()
On Error Resume Next
Dim i As Integer
Dim j As Integer
Set rstclassroom = db.OpenRecordset("select * from courseclassroom")
rstclassroom.Filter = "classroomid='" & Txtclassroomid.Text & "'"
Set rstclassroom = rstclassroom.OpenRecordset()
rstclassroom.edit
For i = 1 To 5
For j = 1 To 4
rstclassroom.Fields(i & j) = "1"
Next j
Next i
rstclassroom.Update
End Sub
Private Sub Cmdexit_Click()
db.Close
Unload Me
frmmain.Show vbModal
End Sub
Private Sub DataGrid1_Click()
Txtclassroomid.Text = DataGrid1.Text
End Sub
Private Sub Form_Load()
Set db = DBEngine.Workspaces(0).OpenDatabase("d:\coursetable.mdb")
Txtclassroomid.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 txtclassroomid_Change()
Dim i As Integer
Dim j As Integer
Set rstclassroom = db.OpenRecordset("select * from courseclassroom")
rstclassroom.Filter = "classroomid='" & Txtclassroomid.Text & "'"
Set rstclassroom = rstclassroom.OpenRecordset()
If rstclassroom.RecordCount() = 0 Then
MsgBox "请选择教师编号!"
Else
If rstclassroom.Fields("11") = "a" Then
Chk11.Value = 1
Else
Chk11.Value = 0
End If
If rstclassroom.Fields("12") = "a" Then
Chk12.Value = 1
Else
Chk12.Value = 0
End If
If rstclassroom.Fields("13") = "a" Then
Chk13.Value = 1
Else
Chk13.Value = 0
End If
If rstclassroom.Fields("14") = "a" Then
Chk14.Value = 1
Else
Chk14.Value = 0
End If
If rstclassroom.Fields("21") = "a" Then
Chk21.Value = 1
Else
Chk21.Value = 0
End If
If rstclassroom.Fields("22") = "a" Then
Chk22.Value = 1
Else
Chk22.Value = 0
End If
If rstclassroom.Fields("23") = "a" Then
Chk23.Value = 1
Else
Chk23.Value = 0
End If
If rstclassroom.Fields("24") = "a" Then
Chk24.Value = 1
Else
Chk24.Value = 0
End If
If rstclassroom.Fields("31") = "a" Then
Chk31.Value = 1
Else
Chk31.Value = 0
End If
If rstclassroom.Fields("32") = "a" Then
Chk32.Value = 1
Else
Chk32.Value = 0
End If
If rstclassroom.Fields("33") = "a" Then
Chk33.Value = 1
Else
Chk33.Value = 0
End If
If rstclassroom.Fields("34") = "a" Then
Chk34.Value = 1
Else
Chk34.Value = 0
End If
If rstclassroom.Fields("41") = "a" Then
Chk41.Value = 1
Else
Chk41.Value = 0
End If
If rstclassroom.Fields("42") = "a" Then
Chk42.Value = 1
Else
Chk42.Value = 0
End If
If rstclassroom.Fields("43") = "a" Then
Chk43.Value = 1
Else
Chk43.Value = 0
End If
If rstclassroom.Fields("44") = "a" Then
Chk44.Value = 1
Else
Chk44.Value = 0
End If
If rstclassroom.Fields("51") = "a" Then
Chk51.Value = 1
Else
Chk51.Value = 0
End If
If rstclassroom.Fields("52") = "a" Then
Chk52.Value = 1
Else
Chk52.Value = 0
End If
If rstclassroom.Fields("53") = "a" Then
Chk53.Value = 1
Else
Chk53.Value = 0
End If
If rstclassroom.Fields("54") = "a" Then
Chk54.Value = 1
Else
Chk54.Value = 0
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -