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

📄 kflr.frm

📁 酒店管理系统 主要是实现了酒店的客房管理
💻 FRM
字号:
VERSION 5.00
Begin VB.Form kflr 
   Caption         =   "客房录入"
   ClientHeight    =   3825
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4815
   LinkTopic       =   "Form3"
   ScaleHeight     =   3825
   ScaleWidth      =   4815
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   2880
      TabIndex        =   14
      Top             =   3240
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保存"
      Height          =   495
      Left            =   600
      TabIndex        =   13
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Height          =   3135
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   4575
      Begin VB.TextBox Text3 
         Height          =   300
         Left            =   1200
         TabIndex        =   12
         Top             =   2640
         Width           =   3255
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   1200
         TabIndex        =   11
         Top             =   1680
         Width           =   3255
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   1200
         TabIndex        =   10
         Top             =   1200
         Width           =   3255
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1200
         TabIndex        =   9
         Top             =   720
         Width           =   3255
      End
      Begin VB.TextBox Text2 
         Height          =   300
         Left            =   1200
         TabIndex        =   8
         Top             =   2160
         Width           =   3255
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Left            =   1200
         TabIndex        =   7
         Top             =   240
         Width           =   3255
      End
      Begin VB.Label Label6 
         Caption         =   "容纳人数:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   2640
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "标准价:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         TabIndex        =   5
         Top             =   2160
         Width           =   1335
      End
      Begin VB.Label Label4 
         Caption         =   "状态:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         TabIndex        =   4
         Top             =   1680
         Width           =   975
      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          =   375
         Left            =   120
         TabIndex        =   3
         Top             =   1200
         Width           =   735
      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          =   375
         Left            =   120
         TabIndex        =   2
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "房号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   855
      End
   End
   Begin VB.Label Label7 
      Caption         =   "Label7"
      Height          =   615
      Left            =   6360
      TabIndex        =   15
      Top             =   480
      Width           =   975
   End
End
Attribute VB_Name = "kflr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rs_bookstyle As New ADODB.Recordset
Dim conn As String
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kfgl.mdb;Persist Security Info=False"
Dim sql As String

If Text1.Text = "" Then
   MsgBox "房号不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If

If Combo1.Text = "" Then
   MsgBox "类别不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If
If Combo2.Text = "" Then
   MsgBox "楼层不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If
If Combo3.Text = "" Then
   MsgBox "状态不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If
If Text2.Text = "" Then
   MsgBox "标准价不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If
If Text3.Text = "" Then
   MsgBox "容纳人数不能为空!", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If


sql = "select * from kf where 房号='" & Text1.Text & "'"
rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_bookstyle.EOF Then
   rs_bookstyle.AddNew
   rs_bookstyle.Fields(0) = Trim(Text1.Text)
   rs_bookstyle.Fields(1) = Trim(Combo1.Text)
   rs_bookstyle.Fields(2) = Trim(Combo2.Text)
   rs_bookstyle.Fields(3) = Trim(Combo3.Text)
   rs_bookstyle.Fields(4) = Trim(Text2.Text) '
   rs_bookstyle.Fields(5) = Trim(Text3.Text)
   'rs_bookstyle.Fields(6) = Trim(Label7.Caption)
  
  
  
   
   MsgBox "设置成功!", vbOKOnly, ""
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""

   Combo1.Text = ""
   Combo2.Text = ""
   Combo3.Text = ""
    rs_bookstyle.Update
    rs_bookstyle.Close
Else
   MsgBox "房号重复!", vbOKOnly + vbExclamation, ""
   Text1.SetFocus
   Text1.Text = ""
   rs_bookstyle.Close
   Exit Sub
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Combo1.AddItem "单人间"
Combo1.AddItem "双人间"
Combo1.AddItem "四人间"
Combo1.AddItem "豪华间"
Combo2.AddItem "一楼"
Combo2.AddItem "二楼"
Combo2.AddItem "三楼"
Combo2.AddItem "四楼"
Combo2.AddItem "五楼"
Combo3.AddItem "入住"
Combo3.AddItem "空房"
'Label7.Caption = "0"
End Sub

⌨️ 快捷键说明

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