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

📄 修改.frm

📁 vb access客房管理系统经典实例添加了模块与access连接
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form7 
   Caption         =   "修改信息框"
   ClientHeight    =   3750
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5355
   Icon            =   "修改.frx":0000
   LinkTopic       =   "Form7"
   MDIChild        =   -1  'True
   Picture         =   "修改.frx":0442
   ScaleHeight     =   3750
   ScaleWidth      =   5355
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1320
      TabIndex        =   8
      Top             =   240
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1320
      TabIndex        =   7
      Top             =   960
      Width           =   1335
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1320
      TabIndex        =   6
      Top             =   1680
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   1320
      TabIndex        =   5
      Top             =   2400
      Width           =   1335
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   1320
      TabIndex        =   4
      Top             =   3120
      Width           =   1335
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   3840
      TabIndex        =   3
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text7 
      Height          =   375
      Left            =   3840
      TabIndex        =   2
      Top             =   960
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   3960
      TabIndex        =   1
      Top             =   2520
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   3960
      TabIndex        =   0
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "登记号:"
      Height          =   375
      Left            =   120
      TabIndex        =   15
      Top             =   360
      Width           =   1095
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "客人姓名:"
      Height          =   375
      Left            =   120
      TabIndex        =   14
      Top             =   1080
      Width           =   1095
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "身份证号码:"
      Height          =   375
      Left            =   120
      TabIndex        =   13
      Top             =   1800
      Width           =   1095
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "房间号:"
      Height          =   375
      Left            =   120
      TabIndex        =   12
      Top             =   2520
      Width           =   1095
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "登记日期:"
      Height          =   375
      Left            =   120
      TabIndex        =   11
      Top             =   3240
      Width           =   1095
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "性别:"
      Height          =   375
      Left            =   3240
      TabIndex        =   10
      Top             =   360
      Width           =   735
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "籍贯:"
      Height          =   375
      Left            =   3240
      TabIndex        =   9
      Top             =   1080
      Width           =   735
   End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rs1 As ADODB.Recordset

Private Sub Command1_Click()
rs1(0) = Text1
rs1(1) = Text2
rs1(2) = Text3
rs1(3) = Text4
rs1(4) = Text5

rs1(6) = Text7

rs1.Update
MsgBox "修改成功!", , "成功"
Set Form5.DataGrid1.DataSource = rs1
Form5.DataGrid1.Refresh
Unload Me


End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Form_Load()
Form7.Height = 4155
Form7.Width = 5475
Call lj
Set rs1 = New ADODB.Recordset
rs1.Open "select * from 旅客信息表 where BookNo = '" & Form5.Text1 & "' or RoomNo = '" & Form5.Text1 & "' or GuestName = '" & Form5.Text1 & "'", conn, adOpenKeyset, adLockOptimistic
Text1 = rs1(0)
Text2 = rs1(1)
Text3 = rs1(2)
Text4 = rs1(3)
Text5 = rs1(4)
Text6 = rs1(5)
Text7 = rs1(6)
End Sub
'or GuestName=text1.text or BookNo=text1.text

⌨️ 快捷键说明

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