📄 main_ftcx.frm
字号:
Caption = "8318"
Height = 870
Index = 18
Left = 2265
Style = 1 'Graphical
TabIndex = 10
Top = 2760
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8319"
Height = 870
Index = 19
Left = 3330
Style = 1 'Graphical
TabIndex = 9
Top = 2760
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8401"
Height = 870
Index = 20
Left = 4395
Style = 1 'Graphical
TabIndex = 8
Top = 2760
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8402"
Height = 870
Index = 21
Left = 135
Style = 1 'Graphical
TabIndex = 7
Top = 3615
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8403"
Height = 870
Index = 22
Left = 1200
Style = 1 'Graphical
TabIndex = 6
Top = 3615
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8404"
Height = 870
Index = 23
Left = 2265
Style = 1 'Graphical
TabIndex = 5
Top = 3615
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8406"
Height = 870
Index = 24
Left = 3330
Style = 1 'Graphical
TabIndex = 4
Top = 3615
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "8408"
Height = 870
Index = 25
Left = 4395
Style = 1 'Graphical
TabIndex = 3
Top = 3615
Width = 1080
End
End
Begin VB.Frame Frame2
Caption = "注释"
Height = 540
Left = 45
TabIndex = 0
Top = 4560
Width = 7440
Begin VB.Label Labsyl
ForeColor = &H000000FF&
Height = 285
Left = 5730
TabIndex = 1
Top = 225
Width = 855
End
Begin VB.Label Labsy
ForeColor = &H000000FF&
Height = 285
Left = 690
TabIndex = 28
Top = 210
Width = 780
End
Begin VB.Label Labkx
ForeColor = &H000000FF&
Height = 285
Left = 2145
TabIndex = 29
Top = 225
Width = 705
End
Begin VB.Label Labwx
ForeColor = &H000000FF&
Height = 285
Left = 3540
TabIndex = 30
Top = 225
Width = 915
End
Begin VB.Label Lab4
Caption = "入住: 空闲: 维修: 房间使用率:"
ForeColor = &H00FF0000&
Height = 270
Left = 75
TabIndex = 31
Top = 225
Width = 7335
End
End
Begin VB.Image Image1
Height = 360
Left = 6315
Picture = "main_ftcx.frx":09C2
Stretch = -1 'True
Top = 735
Width = 345
End
Begin VB.Label Lab1
BackStyle = 0 'Transparent
Caption = "入住"
ForeColor = &H000040C0&
Height = 390
Left = 6780
TabIndex = 36
Top = 750
Width = 510
End
Begin VB.Label Lab2
BackStyle = 0 'Transparent
Caption = "空闲"
ForeColor = &H000040C0&
Height = 390
Left = 6780
TabIndex = 35
Top = 1500
Width = 510
End
Begin VB.Label Lab3
BackStyle = 0 'Transparent
Caption = "维修"
ForeColor = &H000040C0&
Height = 390
Left = 6780
TabIndex = 34
Top = 2205
Width = 510
End
Begin VB.Image Image2
Height = 360
Left = 6315
Picture = "main_ftcx.frx":1204
Stretch = -1 'True
Top = 2130
Width = 345
End
End
Attribute VB_Name = "main_ftcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
Dim i As Integer '定义一个整型变量
Dim criteria As String '定义一个字符串变量
Dim mydb1 As Database '定义数据库
Dim myrs1 As Recordset '定义字段
Dim myrs2 As Recordset
Dim myrs3 As Recordset
Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb") '定义数据环境
Set myrs1 = mydb1.OpenRecordset("kf", dbOpenSnapshot) '定义数据表
'入住房间查询
sql = "select * from kf where kf.房态 like " + Chr(34) + "入住" + Chr(34) + ""
Set myrs2 = mydb1.OpenRecordset(sql)
'维修房间查询
sql = "select * from kf where kf.房态 like " + Chr(34) + "维修" + Chr(34) + ""
Set myrs3 = mydb1.OpenRecordset(sql)
For i = 1 To 25 '房态显示
criteria = "房间号 ='" & Command1(i).Caption & "'"
myrs1.FindFirst criteria
If myrs1.NoMatch Then
Else
If myrs1.Fields("房态") = "空房" Then Command1(i).Picture = LoadPicture("") '空房
If myrs1.Fields("房态") = "入住" Then Command1(i).Picture = LoadPicture(App.Path & "\image\rz.ico")
If myrs1.Fields("房态") = "维修" Then Command1(i).Picture = LoadPicture(App.Path & "\image\wx.ico")
End If
Next i
If Not myrs2.EOF Then myrs2.MoveLast
If Not myrs3.EOF Then myrs3.MoveLast
Labsy.Caption = myrs2.RecordCount '客房入住数
Labwx.Caption = myrs3.RecordCount '客房维修数
Labkx.Caption = 25 - Val(Labwx.Caption) - Val(Labsy.Caption) '客房空闲数
Labsyl.Caption = Val(Labsy.Caption) / 25 * 100 & "%" '客房使用率
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
End Sub
Private Sub Command1_Click(Index As Integer) '查询住宿信息
main_zscx.Text2.Text = "1"
If Index >= 0 <= 25 Then
main_zscx.Data1.RecordSource = "select * from djb where 标志='1'and 房间号='" & Command1(Index).Caption & "'"
main_zscx.Data1.Refresh
End If
Load main_zscx
main_zscx.Show
End Sub
Private Sub Command2_Click()
Unload Me
main.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -