⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsetsearch.frm

📁 用VB编写的酒店管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmSetSearch 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "客房查询"
   ClientHeight    =   1725
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5325
   Icon            =   "FrmSetSearch.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1725
   ScaleWidth      =   5325
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox cmb_Field 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   1320
      TabIndex        =   1
      Top             =   360
      Width           =   1935
   End
   Begin VB.TextBox txt_Value 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1320
      TabIndex        =   0
      Top             =   960
      Width           =   1935
   End
   Begin VB.PictureBox CmdExit 
      Height          =   495
      Index           =   0
      Left            =   3720
      ScaleHeight     =   435
      ScaleWidth      =   1275
      TabIndex        =   4
      ToolTipText     =   "关闭"
      Top             =   960
      Width           =   1335
   End
   Begin VB.PictureBox CmdSearch 
      Height          =   495
      Left            =   3720
      ScaleHeight     =   435
      ScaleWidth      =   1275
      TabIndex        =   5
      ToolTipText     =   "查询"
      Top             =   240
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "查询字段:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   3
      Top             =   480
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "输入数值:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   1080
      Width           =   1095
   End
   Begin VB.Shape Shape1 
      Height          =   1695
      Left            =   0
      Top             =   0
      Width           =   5295
   End
End
Attribute VB_Name = "FrmSetSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim sqlstr, msgstr As String

Private Sub CmdExit_Click(Index As Integer)
Unload Me
End Sub

Private Sub Form_Load()
cmb_Field.AddItem "客房编号"
cmb_Field.AddItem "客房类型"
'cmb_Field.AddItem "客房单价"
cmb_Field.AddItem "客房配置"
'cmb_Field.AddItem "床位"
cmb_Field.AddItem "备注"

End Sub
Private Sub CmdSearch_Click()
If rights = 2 Then
   MsgBox "对不起,你没有此权限!", vbInformation, "警告"
   Exit Sub
End If
FrmSet.Show
sqlstr = "select 客房编号,客房类型,客房单价,客房配置,床位,备注 from guestroom_info where " & cmb_Field.Text & "='" & txt_Value.Text & "'"

Set rs = ExecuteSQL(sqlstr, msgstr)

 If rs.EOF Then
   MsgBox "数据库为空,请输入", vbInformation, ""
   Exit Sub
 Else
 FrmSet.tabSet.Clear
 FrmSet.tabSet.ClearStructure
 FrmSet.tabSet.Rows = rs.RecordCount + 1
 FrmSet.tabSet.Row = 0
 With FrmSet.tabSet
     .Cols = 6
     .TextMatrix(0, 0) = "客房编号"
     .TextMatrix(0, 1) = "客房类型"
     .TextMatrix(0, 2) = "客房单价"
     .TextMatrix(0, 3) = "客房配置"
     .TextMatrix(0, 4) = "床位"
     .TextMatrix(0, 5) = "备注"
End With
 I = 0
 Do While Not rs.EOF
   I = I + 1
   FrmSet.tabSet.Row = I
   For j = 0 To 5
   FrmSet.tabSet.Col = j
   If IsNull(rs.Fields(j)) Then
       FrmSet.tabSet.TextMatrix(I, j) = ""
   Else
       FrmSet.tabSet.TextMatrix(I, j) = rs.Fields(j)
   End If
   Next j
   rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing

Unload Me
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -