📄 frmroomsurplus.frm
字号:
VERSION 5.00
Begin VB.Form frmRoomsurplus
BackColor = &H00C0C0FF&
BorderStyle = 1 'Fixed Single
Caption = "剩余客房查询"
ClientHeight = 2865
ClientLeft = 45
ClientTop = 330
ClientWidth = 3930
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2865
ScaleWidth = 3930
StartUpPosition = 3 '窗口缺省
Begin VB.CheckBox chkItem
BackColor = &H00C0C0FF&
Height = 255
Index = 1
Left = 240
TabIndex = 9
Top = 840
Width = 255
End
Begin VB.CommandButton cmdExit
BackColor = &H00C0C0FF&
Caption = "取消(&X)"
Height = 375
Left = 2160
Style = 1 'Graphical
TabIndex = 8
Top = 2280
Width = 1215
End
Begin VB.CommandButton cmdOk
BackColor = &H00C0C0FF&
Caption = "确定(&O)"
Height = 375
Left = 600
Style = 1 'Graphical
TabIndex = 7
Top = 2280
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H00C0C0FF&
Caption = "客房单价"
Height = 1335
Left = 600
TabIndex = 2
Top = 840
Width = 3015
Begin VB.ComboBox Combo1
Height = 300
Index = 2
Left = 1200
TabIndex = 6
Top = 840
Width = 1575
End
Begin VB.ComboBox Combo1
Height = 300
Index = 1
Left = 1200
TabIndex = 5
Top = 360
Width = 1575
End
Begin VB.Label Label2
BackColor = &H00C0C0FF&
Caption = "大 于"
Height = 375
Left = 240
TabIndex = 4
Top = 840
Width = 615
End
Begin VB.Label Label1
BackColor = &H00C0C0FF&
Caption = "小 于"
Height = 255
Left = 240
TabIndex = 3
Top = 360
Width = 495
End
End
Begin VB.ComboBox Combol
Height = 300
Index = 0
Left = 1800
TabIndex = 1
Top = 360
Width = 1575
End
Begin VB.CheckBox chkItem
BackColor = &H00C0C0FF&
Caption = "客房种类:"
Height = 375
Index = 0
Left = 240
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "frmRoomsurplus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chkItem_Click(Index As Integer)
If Index = 0 Then
If chkItem(Index).Value = vbChecked Then
Combol(Index).Enabled = True
End If
Else
If chkItem(Index).Value = vbChecked Then
Combo1(1).Enabled = True
Combo1(2).Enabled = True
End If
End If
End Sub
Private Sub cmdExit_Click()
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim sQSql As String
If chkItem(0).Value = vbChecked Then
sQSql = " roomtype = '" & Trim(Combol(0) & " ") & "'"
End If
If chkItem(1).Value = vbChecked Then
If Trim(sQSql & " ") = "" Then
If Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") <> "" Then
sQSql = " roomprice <='" & Trim(Combo1(1) & " ") & "'and roomprice >= '" & Trim(Combo1(2) & " ") & "'"
ElseIf Trim(Combo1(1) & " ") = "" And Trim(Combo1(2) & " ") <> "" Then
sQSql = " roomprice >='" & Trim(Combo1(2) & " ") & "'"
ElseIf Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") = "" Then
sQSql = " roomprice <='" & Trim(Combo1(1) & " ") & "'"
End If
Else
If Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") <> "" Then
sQSql = sQSql & " and roomprice >='" & Trim(Combo1(1) & " ") & "'and roomprice >= '" & Trim(Combo1(2) & " ") & "'"
ElseIf Trim(Combo1(1) & " ") = "" And Trim(Combo1(2) & " ") <> "" Then
sQSql = sQSql & " and roomprice >='" & Trim(Combo1(2) & " ") & "'"
ElseIf Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") = "" Then
sQSql = sQSql & " and roomprice <='" & Trim(Combo1(1) & " ") & "'"
End If
End If
End If
If Trim(sQSql) = "" Then
MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
If flagRedit Then
Unload frmRoom
End If
frmRoom.txtSQL = "select * from rooms where" & sQSql & "and putup <> 'y'"
frmRoom.Show
flagSedit = True
End If
Me.Hide
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
txtSQL = "select distinct typename from roomtype"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
Do While Not mrc.EOF
Combol(0).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
End If
mrc.Close
txtSQL = "select distinct price from roomtype"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
Do While Not mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
End If
mrc.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -