📄 frmliveupdate.frm
字号:
VERSION 5.00
Begin VB.Form frmliveupdate
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "宿舍信息修改"
ClientHeight = 6450
ClientLeft = 45
ClientTop = 435
ClientWidth = 3630
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6450
ScaleWidth = 3630
Begin VB.Frame Frame2
BackColor = &H00FFFFFF&
Caption = "按个人进行查询"
Height = 4815
Left = 120
TabIndex = 4
Top = 1560
Width = 3375
Begin VB.ComboBox cobcollege
Height = 300
Left = 1080
TabIndex = 16
Text = "cobcollege"
Top = 240
Width = 1935
End
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 255
Left = 120
ScaleHeight = 255
ScaleWidth = 3135
TabIndex = 12
Top = 1320
Width = 3135
Begin VB.OptionButton Option1
BackColor = &H00FFFFFF&
Caption = "按学号显示"
Height = 255
Left = 0
TabIndex = 14
Top = 0
Width = 1215
End
Begin VB.OptionButton Option2
BackColor = &H00FFFFFF&
Caption = "按姓名显示"
Height = 255
Left = 1680
TabIndex = 13
Top = 0
Width = 1335
End
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 420
Left = 480
TabIndex = 11
Top = 4200
Width = 1050
End
Begin VB.ListBox List1
Height = 2400
Left = 120
TabIndex = 10
Top = 1680
Width = 3135
End
Begin VB.CommandButton CmdQuit
Cancel = -1 'True
Caption = "返回"
Height = 420
Left = 1920
TabIndex = 9
Top = 4200
Width = 1050
End
Begin VB.ComboBox cobclass
Height = 300
Left = 1080
TabIndex = 8
Text = "cobclass"
Top = 960
Width = 1935
End
Begin VB.ComboBox cobsp
Height = 300
Left = 1080
TabIndex = 6
Text = "cobsp"
Top = 600
Width = 1935
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
Caption = "学院:"
Height = 255
Left = 240
TabIndex = 15
Top = 240
Width = 615
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "班别:"
Height = 255
Left = 240
TabIndex = 7
Top = 960
Width = 615
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "专业:"
Height = 255
Left = 240
TabIndex = 5
Top = 600
Width = 615
End
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
Caption = "按宿舍进行查询"
Height = 1410
Left = 120
TabIndex = 0
Top = 120
Width = 3345
Begin VB.CommandButton CmdOK
Caption = "确认"
Default = -1 'True
Height = 375
Left = 1080
TabIndex = 2
Top = 840
Width = 1050
End
Begin VB.ComboBox coblive
Height = 300
Left = 1440
TabIndex = 1
Text = "coblive"
Top = 360
Width = 1695
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "选择宿舍:"
Height = 360
Left = 360
TabIndex = 3
Top = 360
Width = 945
End
End
End
Attribute VB_Name = "frmliveupdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public fup As String
Private Sub CmdOK_Click()
Dim sCon As String
Dim scon1 As String
sCon = "select * from Room where 宿舍='" & Trim(coblive.Text) & "'"
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
MsgBox "编号为:" & Trim(coblive.Text) & "的宿舍资料不存在!", vbOKOnly + vbExclamation, "系统提示"
coblive.SetFocus
Exit Sub
Else
fup = Trim(coblive.Text)
Option1.Value = False
Option2.Value = False
Me.Hide
frmliveupdate2.Show
End If
End Sub
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub cobclass_Click()
If Option1.Value = True Then
Option1.Value = False
End If
If Option2.Value = True Then
Option2.Value = False
End If
End Sub
Private Sub cobcollege_Click()
'专业
sql = ""
sql = "select 专业 from Spcollege where 学院='" & cobcollege.Text & "'"
Set adoRS = adoCon.Execute(sql)
cobsp.Clear
Do While Not adoRS.EOF
cobsp.AddItem Trim(adoRS("专业"))
adoRS.MoveNext
Loop
cobsp.ListIndex = 0
End Sub
Private Sub cobsp_Click()
'班级
sql = ""
sql = "select 班级 from Spclass where 专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(sql)
cobclass.Clear
Do While Not adoRS.EOF
cobclass.AddItem Trim(adoRS("班级"))
adoRS.MoveNext
Loop
cobclass.ListIndex = 0
Option1.Value = False
Option2.Value = False
End Sub
Private Sub Command1_Click()
Dim sCon As String
Dim scon1 As String
If Option1.Value = True Then
sCon = "select * from Room where 学号='" & Trim(List1.Text) & "'"
End If
If Option2.Value = True Then
sCon = "select * from Room where 姓名='" & Trim(List1.Text) & "'"
End If
If Option1.Value = False And Option2.Value = False Then
MsgBox "请选择查询方式!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
MsgBox Trim(List1.Text) & "的学生资料不存在!", vbOKOnly + vbExclamation, "系统提示"
cobclass.SetFocus
Exit Sub
Else
fup = Trim(List1.Text)
Me.Hide
frmliveupdate2.Show
End If
End Sub
Private Sub Form_Load()
Me.Width = 3750
Me.Height = 6930
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 600
Me.Show
coblive.SetFocus
'宿舍
Set adoRS = adoCon.Execute("Select Name From Live Order By Name")
coblive.Clear
Do While Not adoRS.EOF
coblive.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
coblive.ListIndex = 0
'学院
Set adoRS = adoCon.Execute("Select Name From College Order By Name")
cobcollege.Clear
Do While Not adoRS.EOF
cobcollege.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
cobcollege.ListIndex = 0
End Sub
Private Sub Option1_Click()
'学号
sql = "select * from Student where Class='" & Trim(cobclass.Text) & "' order by ID "
Set adoRS = adoCon.Execute(sql)
List1.Clear
Do While adoRS.EOF
MsgBox "该学生尚未安排宿舍!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
Loop
If cobclass.Text = "" Then
MsgBox "请选择班级!", vbOKOnly + vbExclamation, "系统提示"
End If
Do While Not adoRS.EOF
List1.AddItem Trim(adoRS("ID"))
adoRS.MoveNext
Loop
End Sub
Private Sub Option2_Click()
'姓名
sql = "select * from Student where Class='" & Trim(cobclass.Text) & "' order by ID "
Set adoRS = adoCon.Execute(sql)
List1.Clear
Do While adoRS.EOF
MsgBox "该学生尚未安排宿舍!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
Loop
If cobclass.Text = "" Then
MsgBox "请选择班级!", vbOKOnly + vbExclamation, "系统提示"
End If
Do While Not adoRS.EOF
List1.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -