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

📄 form6.frm

📁 VB和ACCESS作的管理酒店住书软件
💻 FRM
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form Form6 
   BackColor       =   &H00C0E0FF&
   Caption         =   "Form6"
   ClientHeight    =   3360
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5115
   LinkTopic       =   "Form6"
   Moveable        =   0   'False
   ScaleHeight     =   8595
   ScaleWidth      =   11880
   StartUpPosition =   2  'CenterScreen
   Begin TabDlg.SSTab SSTab1 
      Height          =   3135
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4935
      _ExtentX        =   8705
      _ExtentY        =   5530
      _Version        =   393216
      Tab             =   2
      TabHeight       =   520
      BackColor       =   -2147483648
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "仿宋_GB2312"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      TabCaption(0)   =   "增加房间"
      TabPicture(0)   =   "Form6.frx":0000
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "Label1"
      Tab(0).Control(1)=   "Label2"
      Tab(0).Control(2)=   "Label3"
      Tab(0).Control(3)=   "Label4"
      Tab(0).Control(4)=   "lx"
      Tab(0).Control(5)=   "hm"
      Tab(0).Control(6)=   "cs"
      Tab(0).Control(7)=   "dhhm"
      Tab(0).Control(8)=   "Command1"
      Tab(0).Control(9)=   "Command2"
      Tab(0).ControlCount=   10
      TabCaption(1)   =   "删除房间"
      TabPicture(1)   =   "Form6.frx":001C
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Label5"
      Tab(1).Control(1)=   "Label6"
      Tab(1).Control(2)=   "Label7"
      Tab(1).Control(3)=   "Label8"
      Tab(1).Control(4)=   "Command3"
      Tab(1).Control(5)=   "Command4"
      Tab(1).Control(6)=   "dh"
      Tab(1).Control(7)=   "zcs"
      Tab(1).Control(8)=   "fj"
      Tab(1).Control(9)=   "fjhm"
      Tab(1).ControlCount=   10
      TabCaption(2)   =   "修改房间"
      TabPicture(2)   =   "Form6.frx":0038
      Tab(2).ControlEnabled=   -1  'True
      Tab(2).Control(0)=   "Label9"
      Tab(2).Control(0).Enabled=   0   'False
      Tab(2).Control(1)=   "Label10"
      Tab(2).Control(1).Enabled=   0   'False
      Tab(2).Control(2)=   "Label11"
      Tab(2).Control(2).Enabled=   0   'False
      Tab(2).Control(3)=   "Label12"
      Tab(2).Control(3).Enabled=   0   'False
      Tab(2).Control(4)=   "Command5"
      Tab(2).Control(4).Enabled=   0   'False
      Tab(2).Control(5)=   "Command6"
      Tab(2).Control(5).Enabled=   0   'False
      Tab(2).Control(6)=   "xd"
      Tab(2).Control(6).Enabled=   0   'False
      Tab(2).Control(7)=   "xc"
      Tab(2).Control(7).Enabled=   0   'False
      Tab(2).Control(8)=   "fjlx"
      Tab(2).Control(8).Enabled=   0   'False
      Tab(2).Control(9)=   "xh"
      Tab(2).Control(9).Enabled=   0   'False
      Tab(2).ControlCount=   10
      Begin VB.ComboBox xh 
         Height          =   315
         Left            =   1200
         TabIndex        =   30
         Top             =   1560
         Width           =   1335
      End
      Begin VB.ComboBox fjlx 
         Height          =   315
         Left            =   1200
         TabIndex        =   25
         Top             =   960
         Width           =   1335
      End
      Begin VB.TextBox xc 
         Height          =   315
         Left            =   1200
         TabIndex        =   24
         Top             =   2160
         Width           =   1335
      End
      Begin VB.TextBox xd 
         Height          =   315
         Left            =   1200
         TabIndex        =   23
         Top             =   2640
         Width           =   1335
      End
      Begin VB.CommandButton Command6 
         Caption         =   "修改"
         Height          =   375
         Left            =   3240
         TabIndex        =   22
         Top             =   1200
         Width           =   975
      End
      Begin VB.CommandButton Command5 
         Caption         =   "取消"
         Height          =   375
         Left            =   3240
         TabIndex        =   21
         Top             =   2280
         Width           =   975
      End
      Begin VB.ComboBox fjhm 
         Height          =   315
         Left            =   -73800
         TabIndex        =   20
         Top             =   1560
         Width           =   1335
      End
      Begin VB.ComboBox fj 
         Height          =   315
         Left            =   -73800
         TabIndex        =   15
         Top             =   960
         Width           =   1335
      End
      Begin VB.TextBox zcs 
         Height          =   315
         Left            =   -73800
         TabIndex        =   14
         Top             =   2160
         Width           =   1335
      End
      Begin VB.TextBox dh 
         Height          =   315
         Left            =   -73800
         TabIndex        =   13
         Top             =   2640
         Width           =   1335
      End
      Begin VB.CommandButton Command4 
         Caption         =   "删除"
         Height          =   375
         Left            =   -71760
         TabIndex        =   12
         Top             =   1200
         Width           =   975
      End
      Begin VB.CommandButton Command3 
         Caption         =   "取消"
         Height          =   375
         Left            =   -71760
         TabIndex        =   11
         Top             =   2280
         Width           =   975
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消"
         Height          =   375
         Left            =   -71760
         TabIndex        =   10
         Top             =   2280
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "添加"
         Height          =   375
         Left            =   -71760
         TabIndex        =   9
         Top             =   1200
         Width           =   975
      End
      Begin VB.TextBox dhhm 
         Height          =   315
         Left            =   -73800
         TabIndex        =   8
         Top             =   2640
         Width           =   1335
      End
      Begin VB.TextBox cs 
         Height          =   315
         Left            =   -73800
         TabIndex        =   6
         Top             =   2160
         Width           =   1335
      End
      Begin VB.TextBox hm 
         Height          =   315
         Left            =   -73800
         TabIndex        =   4
         Top             =   1560
         Width           =   1335
      End
      Begin VB.ComboBox lx 
         Height          =   315
         Left            =   -73800
         TabIndex        =   2
         Top             =   960
         Width           =   1335
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         Caption         =   "房间类型"
         Height          =   195
         Left            =   360
         TabIndex        =   29
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "房间号码"
         Height          =   195
         Left            =   360
         TabIndex        =   28
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "总床位数"
         Height          =   195
         Left            =   360
         TabIndex        =   27
         Top             =   2160
         Width           =   720
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "电话号码"
         Height          =   195
         Left            =   360
         TabIndex        =   26
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "房间类型"
         Height          =   195
         Left            =   -74640
         TabIndex        =   19
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "房间号码"
         Height          =   195
         Left            =   -74640
         TabIndex        =   18
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "总床位数"
         Height          =   195
         Left            =   -74640
         TabIndex        =   17
         Top             =   2160
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "电话号码"
         Height          =   195
         Left            =   -74640
         TabIndex        =   16
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "电话号码"
         Height          =   195
         Left            =   -74640
         TabIndex        =   7
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "总床位数"
         Height          =   195
         Left            =   -74640
         TabIndex        =   5
         Top             =   2160
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "房间号码"
         Height          =   195
         Left            =   -74640
         TabIndex        =   3
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "房间类型"
         Height          =   195
         Left            =   -74640
         TabIndex        =   1
         Top             =   960
         Width           =   720
      End
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public rs As ADODB.Recordset
Public db As ADODB.Connection
Private Sub Command1_Click()
Dim i As Integer
rs.Open "insert into 增删房间(房间类型,房间号码,电话号码,总床位数) values('" & Trim(lx.Text) & "','" & Trim(Val(hm.Text)) & "','" & Trim(Val(dhhm.Text)) & "','" & Trim(Val(cs.Text)) & "')", db, adOpenStatic
MsgBox ("添加成功")
rs.Open "select * from 增删房间"
Unload Me
Form6.Show
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
If MsgBox("真的要删除吗?", vbYesNo, "信息提示") = vbYes Then
rs.Open "delete from 增删房间 where 房间号码=val('" & Trim(fjhm.Text) & "')"
MsgBox ("记录已删除")
Unload Me
Form6.Show
Else
End If
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command6_Click()
If MsgBox("真的要修改吗?", vbYesNo, "信息提示") = vbYes Then
rs.Open "delete from 增删房间 where 房间号码=val('" & Trim(xh.Text) & "')"
rs.Open "insert into 增删房间(房间类型,房间号码,电话号码,总床位数) values('" & Trim(fjlx.Text) & "','" & Trim(Val(xh.Text)) & "','" & Trim(Val(xd.Text)) & "','" & Trim(Val(xc.Text)) & "')", db, adOpenStatic
MsgBox ("记录已修改")
Unload Me
Form6.Show
End If
End Sub

Private Sub fj_click()
fjhm.Clear
zcs.Text = ""
dh.Text = ""
Dim i As Integer
rs.Open "select  房间号码 from 增删房间 where 房间类型='" & Trim(fj.Text) & "'", db, adOpenStatic, adLockReadOnly, adCmdText
For i = 1 To rs.RecordCount
fjhm.AddItem rs.Fields(0)
rs.MoveNext
Next
rs.Close
End Sub

Private Sub fjhm_click()
rs.Open "select * from 增删房间 where 房间号码=val('" & Trim(fjhm.Text) & "')", db, adOpenStatic, adLockReadOnly, adCmdText
zcs.Text = rs.Fields(3)
dh.Text = rs.Fields(2)
rs.Close
End Sub

Private Sub fjlx_click()
xh.Clear
xc.Text = ""
xd.Text = ""
Dim i As Integer
rs.Open "select  房间号码 from 增删房间 where 房间类型='" & Trim(fjlx.Text) & "'", db, adOpenStatic, , adCmdText
For i = 1 To rs.RecordCount
xh.AddItem rs.Fields(0)
rs.MoveNext
Next
rs.Close
End Sub

Private Sub Form_Load()
Dim i As Integer
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=hxh"
rs.Open "select distinct 房间类型 from 增删房间", db, adOpenStatic, , adCmdText
For i = 1 To rs.RecordCount
lx.AddItem rs.Fields(0)
fj.AddItem rs.Fields(0)
fjlx.AddItem rs.Fields(0)
rs.MoveNext
Next
rs.Close
End Sub

Private Sub lx_click()
hm.Text = ""
cs.Text = ""
dhhm.Text = ""
End Sub

Private Sub xh_click()
rs.Open "select * from 增删房间 where 房间号码=val('" & Trim(xh.Text) & "')", db, adOpenStatic, , adCmdText
xc.Text = rs.Fields(3)
xd.Text = rs.Fields(2)
rs.Close
End Sub

⌨️ 快捷键说明

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