?? 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 + -