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

📄 frmbookin2.frm

📁 宾馆管理信息系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmBookin2 
   BackColor       =   &H00C0C0FF&
   Caption         =   "订房信息查询"
   ClientHeight    =   2850
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5685
   LinkTopic       =   "Form9"
   ScaleHeight     =   2850
   ScaleWidth      =   5685
   StartUpPosition =   3  '窗口缺省
   Begin VB.CheckBox chkItem 
      BackColor       =   &H00C0C0FF&
      Caption         =   "入住编号:"
      Height          =   255
      Index           =   2
      Left            =   240
      TabIndex        =   11
      Top             =   1200
      Width           =   1215
   End
   Begin VB.CheckBox chkItem 
      BackColor       =   &H00C0C0FF&
      Caption         =   "客房编号:"
      Height          =   255
      Index           =   1
      Left            =   240
      TabIndex        =   10
      Top             =   720
      Width           =   1215
   End
   Begin VB.TextBox txtItem 
      Height          =   270
      Index           =   1
      Left            =   1680
      TabIndex        =   9
      Top             =   720
      Width           =   3255
   End
   Begin VB.CommandButton cmdExit 
      BackColor       =   &H00C0C0FF&
      Caption         =   "取消(&X)"
      Height          =   375
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   2280
      Width           =   1215
   End
   Begin VB.CommandButton cmdOk 
      BackColor       =   &H00C0C0FF&
      Caption         =   "确定(&O)"
      Height          =   375
      Left            =   1080
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   2280
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0C0FF&
      Height          =   975
      Left            =   1680
      TabIndex        =   2
      Top             =   1080
      Width           =   3375
      Begin VB.ComboBox cboDay 
         Height          =   300
         Left            =   2160
         TabIndex        =   13
         Top             =   360
         Width           =   855
      End
      Begin VB.ComboBox cboMonth 
         Height          =   300
         Left            =   1080
         TabIndex        =   12
         Top             =   360
         Width           =   855
      End
      Begin VB.ComboBox cboYear 
         Height          =   300
         Index           =   0
         ItemData        =   "frmbookin2.frx":0000
         Left            =   120
         List            =   "frmbookin2.frx":0002
         TabIndex        =   3
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label3 
         BackColor       =   &H00C0C0FF&
         Caption         =   "日"
         Height          =   255
         Left            =   3000
         TabIndex        =   6
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label2 
         BackColor       =   &H00C0C0FF&
         Caption         =   "月"
         Height          =   255
         Left            =   1920
         TabIndex        =   5
         Top             =   360
         Width           =   135
      End
      Begin VB.Label Label1 
         BackColor       =   &H00C0C0FF&
         Caption         =   "年"
         Height          =   255
         Left            =   840
         TabIndex        =   4
         Top             =   360
         Width           =   255
      End
   End
   Begin VB.TextBox txtItem 
      Height          =   270
      Index           =   0
      Left            =   1680
      TabIndex        =   1
      Top             =   240
      Width           =   3255
   End
   Begin VB.CheckBox chkItem 
      BackColor       =   &H00C0C0FF&
      Caption         =   "顾客姓名:"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "frmBookin2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'用于传递查询
Private Sub chkItem_Click(Index As Integer)
    If Index = 2 Then
        cboYear(0).SetFocus
    Else
        txtItem(Index).SetFocus
    End If
End Sub
Private Sub cmdExit_Click()
    Me.Hide
End Sub
Private Sub cmdOK_Click()
    Dim dBeginDate As String
    Dim sQSql As String
    If chkItem(0).Value = vbChecked Then
        sQSql = " customname = '" & Trim(txtItem(0) & " ") & "'"
    End If
    If chkItem(1).Value = vbChecked Then
        If Trim(sQSql & " ") = "" Then
            sQSql = " roomno ='" & Trim(txtItem(1) & " ") & "'"
        Else
            sQSql = sQSql & " and roomno ='" & Trim(txtItem(1) & " ") & "'"
        End If
    End If
    If chkItem(2).Value = vbChecked Then
        dBeginDate = Format(CDate(cboYear(0) & "-" & cboMonth & "-" & cboDay), "yyyy-mm-dd")
        If Trim(sQSql & " ") = "" Then
            sQSql = " indate ='" & dBeginDate & "'"
        Else
            sQSql = sQSql & " and indate ='" & dBeginDate & "'"
        End If
    End If
    If Trim(sQSql) = "" Then
        MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
    Else
        If flagBedit Then
            Unload frmBookin
        End If
        frmBookin.txtSQL = "select bookno,customname,customID,roomno,indate,discount,inmemo from bookin where ammount = '0' and " & sQSql
        frmBookin.Show
        frmBookin.Command2.Enabled = False
        frmBookin.Command3.Enabled = False
    End If
    Me.Hide
End Sub
Private Sub Form_Load()
    Dim i As Integer
    Dim j As Integer
    Dim sSql As String
    Dim txtSQL As String
    Dim MsgText As String
    Dim mrc As ADODB.Recordset
    txtSQL = "select distinct datepart(yy,indate) from bookin where ammount = '0' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        With mrc
            Do While Not .EOF
                cboYear(0).AddItem .Fields(0)
                .MoveNext
            Loop
        End With
        cboYear(0).ListIndex = 0
        For j = 1 To 12
            cboMonth.AddItem j
        Next j
        cboMonth.Text = Month(Now())
        For j = 1 To 31
            cboDay.AddItem j
        Next j
        cboDay.Text = Day(Now())
    Else
        cmdOK.Enabled = False
    End If
    mrc.Close
End Sub
Private Sub lblitem_Click(Index As Integer)
    chkItem(Index).Value = vbChecked
End Sub
Private Sub txtItem_GotFocus(Index As Integer)
    txtItem(Index).SelStart = 0
    txtItem(Index).SelLength = Len(txtItem(Index))
End Sub

⌨️ 快捷键说明

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