?? form1.frm
字號:
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 = 840
Left = 60
TabIndex = 0
Top = 4560
Width = 7440
Begin VB.Label Label1
ForeColor = &H000000FF&
Height = 315
Left = 5520
TabIndex = 1
Top = 270
Width = 765
End
Begin VB.Label Label4
ForeColor = &H000000FF&
Height = 285
Left = 705
TabIndex = 28
Top = 330
Width = 780
End
Begin VB.Label Label5
ForeColor = &H000000FF&
Height = 285
Left = 2130
TabIndex = 29
Top = 345
Width = 705
End
Begin VB.Label Label7
ForeColor = &H000000FF&
Height = 285
Left = 3525
TabIndex = 30
Top = 330
Width = 915
End
Begin VB.Label Label11
Caption = "房間使用率:"
ForeColor = &H00FF0000&
Height = 270
Left = 4500
TabIndex = 34
Top = 330
Width = 1095
End
Begin VB.Label Label10
Caption = "空閑:"
ForeColor = &H00FF0000&
Height = 270
Left = 1530
TabIndex = 33
Top = 330
Width = 600
End
Begin VB.Label Label9
Caption = "使用:"
ForeColor = &H00FF0000&
Height = 270
Left = 75
TabIndex = 32
Top = 330
Width = 600
End
Begin VB.Label Label8
Caption = "維修:"
ForeColor = &H00FF0000&
Height = 270
Left = 2910
TabIndex = 31
Top = 330
Width = 600
End
End
Begin VB.Image Image1
Height = 480
Left = 6585
Top = 2385
Width = 480
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "入住"
ForeColor = &H000040C0&
Height = 390
Left = 7080
TabIndex = 38
Top = 2460
Width = 510
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "空閑"
ForeColor = &H000040C0&
Height = 390
Left = 7065
TabIndex = 37
Top = 3135
Width = 510
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "維修"
ForeColor = &H000040C0&
Height = 390
Left = 7020
TabIndex = 36
Top = 3795
Width = 510
End
Begin VB.Image Image2
Height = 360
Left = 6555
Stretch = -1 'True
Top = 3705
Width = 345
End
Begin VB.Shape Shape1
Height = 345
Left = 6555
Top = 3060
Width = 375
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "房態(tài)查看"
BeginProperty Font
Name = "宋體"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3270
Left = 30
TabIndex = 35
Top = 630
Width = 855
End
End
Attribute VB_Name = "form1"
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 mydb1 As Database
Dim myrs1 As Recordset
Dim myrs2 As Recordset
Dim myrs3 As Recordset
Dim criteria As String
Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb") ' 定義數(shù)據(jù)環(huán)境
Set myrs1 = mydb1.OpenRecordset("kf", dbOpenSnapshot) '定義數(shù)據(jù)表
'入住房間查詢
SQL = "select * from kf where kf.房態(tài) like " + Chr(34) + "入住" + Chr(34) + ""
Set myrs2 = mydb1.OpenRecordset(SQL)
'維修房間查詢
SQL = "select * from kf where kf.房態(tài) like " + Chr(34) + "維修" + Chr(34) + ""
Set myrs3 = mydb1.OpenRecordset(SQL)
For i = 1 To 25 '房態(tài)顯示
criteria = "房間號 ='" & Command1(i).Caption & "'"
myrs1.FindFirst criteria
If myrs1.NoMatch Then
Else
If myrs1.Fields("房態(tài)") = "空房" Then Command1(i).Picture = LoadPicture("") '空房
If myrs1.Fields("房態(tài)") = "入住" Then Command1(i).Picture = LoadPicture(App.Path & "\rz.ico")
If myrs1.Fields("房態(tài)") = "維修" Then Command1(i).Picture = LoadPicture(App.Path & "\wx.ico")
End If
Next i
If Not myrs2.EOF Then myrs2.MoveLast
If Not myrs3.EOF Then myrs3.MoveLast
Label4.Caption = myrs2.RecordCount '客房入住數(shù)
Label7.Caption = myrs3.RecordCount '客房維修數(shù)
Label5.Caption = 25 - Val(Label7.Caption) - Val(Label4.Caption) '客房空閑數(shù)
Label1.Caption = Val(Label4.Caption) / 25 * 100 & "%" '客房使用率
End Sub
Private Sub Command2_Click()
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -