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

📄 frmupdatebook.frm

📁 中小型图书馆管理系统开发
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmUpdateBook 
   Caption         =   "修改图书信息"
   ClientHeight    =   3285
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8985
   LinkTopic       =   "Form1"
   ScaleHeight     =   3285
   ScaleWidth      =   8985
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame4 
      Height          =   735
      Left            =   6480
      TabIndex        =   22
      Top             =   2280
      Width           =   2415
      Begin VB.CommandButton Command1 
         Caption         =   "返回(&C)"
         Height          =   375
         Left            =   1320
         TabIndex        =   24
         Top             =   240
         Width           =   975
      End
      Begin VB.CommandButton cmdUpdate 
         Caption         =   "修改(&U)"
         Height          =   375
         Left            =   240
         TabIndex        =   23
         Top             =   240
         Width           =   975
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "查询"
      Height          =   2055
      Left            =   6480
      TabIndex        =   18
      Top             =   240
      Width           =   2415
      Begin VB.CommandButton cmdQuery 
         Caption         =   "查询"
         Height          =   375
         Left            =   720
         TabIndex        =   21
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox txtQueryId 
         Height          =   405
         Left            =   480
         TabIndex        =   19
         Text            =   "Text1"
         Top             =   720
         Width           =   1695
      End
      Begin VB.Label Label7 
         Caption         =   "请输入编号:"
         Height          =   255
         Left            =   240
         TabIndex        =   20
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "图书记录信息"
      Height          =   2055
      Left            =   240
      TabIndex        =   5
      Top             =   240
      Width           =   6135
      Begin VB.TextBox txtId 
         Height          =   375
         Left            =   840
         TabIndex        =   11
         Text            =   "Text5"
         Top             =   360
         Width           =   1455
      End
      Begin VB.ComboBox cmbType 
         Height          =   315
         Left            =   3480
         TabIndex        =   10
         Text            =   "Combo1"
         Top             =   360
         Width           =   2415
      End
      Begin VB.TextBox txtISBN 
         Height          =   375
         Left            =   3480
         TabIndex        =   9
         Text            =   "Text4"
         Top             =   1320
         Width           =   2415
      End
      Begin VB.TextBox txtPub 
         Height          =   375
         Left            =   3480
         TabIndex        =   8
         Text            =   "Text3"
         Top             =   840
         Width           =   2415
      End
      Begin VB.TextBox txtPrice 
         Height          =   375
         Left            =   840
         TabIndex        =   7
         Text            =   "Text2"
         Top             =   1320
         Width           =   1455
      End
      Begin VB.TextBox txtName 
         Height          =   375
         Left            =   840
         TabIndex        =   6
         Text            =   "Text1"
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label Label6 
         Caption         =   "编    号:"
         Height          =   375
         Left            =   120
         TabIndex        =   17
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label5 
         Caption         =   "图书类别:"
         Height          =   375
         Left            =   2640
         TabIndex        =   16
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "    ISBN:"
         Height          =   255
         Left            =   2760
         TabIndex        =   15
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "价    格:"
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "出版社:"
         Height          =   375
         Left            =   2760
         TabIndex        =   13
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "书    名:"
         Height          =   255
         Left            =   120
         TabIndex        =   12
         Top             =   960
         Width           =   735
      End
   End
   Begin VB.Frame Frame2 
      Height          =   735
      Left            =   240
      TabIndex        =   0
      Top             =   2280
      Width           =   6135
      Begin VB.CommandButton cmdBefore 
         Caption         =   "上一条"
         Height          =   375
         Left            =   1800
         TabIndex        =   4
         Top             =   240
         Width           =   1095
      End
      Begin VB.CommandButton cmdNext 
         Caption         =   "下一条"
         Height          =   375
         Left            =   3240
         TabIndex        =   3
         Top             =   240
         Width           =   1095
      End
      Begin VB.CommandButton cmdFirst 
         Caption         =   "第一条"
         Height          =   375
         Left            =   360
         TabIndex        =   2
         Top             =   240
         Width           =   1095
      End
      Begin VB.CommandButton cmdLast 
         Caption         =   "最后一条"
         Height          =   375
         Left            =   4680
         TabIndex        =   1
         Top             =   240
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmUpdateBook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dbBook As Database
Dim rsBook As Recordset


Private Sub cmdBefore_Click()
rsBook.MovePrevious
If rsBook.BOF Then rsBook.MoveFirst
showRec

End Sub

Private Sub cmdFirst_Click()
rsBook.MoveFirst
showRec
End Sub

Private Sub cmdLast_Click()
rsBook.MoveLast
showRec
End Sub

Private Sub cmdNext_Click()
rsBook.MoveNext
If rsBook.EOF Then rsBook.MoveLast
showRec

End Sub

Private Sub cmdQuery_Click()
rsBook.Seek "=", txtQueryId.Text
If rsBook.NoMatch = False Then
    showRec
Else
    MsgBox "未找到符合条件的记录!!", vbInformation, "提示"
End If

End Sub

Private Sub cmdUpdate_Click()

rsBook.Edit
rsBook.Fields("bookid") = txtId.Text
rsBook.Fields("bookname") = txtName.Text
rsBook.Fields("bookprice") = txtPrice.Text
rsBook.Fields("ISBN") = txtISBN.Text
rsBook.Fields("publisher") = txtPub.Text
rsBook.Fields("bookType") = cmbType.Text
rsBook.Update

MsgBox "已成功修改记录!!", vbInformation, "提示"

cmdNext_Click

End Sub


Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()

Set dbBook = OpenDatabase(".\db\library.mdb", False)
Set rsBook = dbBook.OpenRecordset("book", dbOpenTable)
rsBook.Index = "bookid"

txtQueryId = ""
txtId.Enabled = False

'显示当前的数据记录
showRec


End Sub

Public Sub showRec()

'将当前记录位置的数据在窗体中显示出来
Dim isbn As String


txtId.Text = rsBook.Fields("bookid")
txtName.Text = rsBook.Fields("bookname")
txtPrice.Text = rsBook.Fields("bookprice")
txtISBN.Text = rsBook.Fields("ISBN")
txtPub.Text = rsBook.Fields("publisher")
cmbType.Text = rsBook.Fields("bookType")

End Sub

⌨️ 快捷键说明

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