📄 frmupdatebook.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmUpdateBook
Caption = "正在修改图书"
ClientHeight = 3570
ClientLeft = 60
ClientTop = 345
ClientWidth = 8970
LinkTopic = "Form1"
MaxButton = 0 'False
Picture = "FrmUpdateBook.frx":0000
ScaleHeight = 3570
ScaleWidth = 8970
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H0000C000&
Caption = "书籍信息"
ForeColor = &H000000C0&
Height = 2655
Left = 360
TabIndex = 0
Top = 240
Width = 8295
Begin MSComCtl2.DTPicker dtpRigDate
Height = 375
Left = 5040
TabIndex = 16
Top = 1560
Width = 3135
_ExtentX = 5530
_ExtentY = 661
_Version = 393216
Format = 57606145
CurrentDate = 37828
End
Begin VB.TextBox txtWriter
Height = 375
Left = 960
TabIndex = 14
Top = 1560
Width = 3015
End
Begin VB.TextBox txtBookConcern
Height = 375
Left = 5040
TabIndex = 11
Top = 960
Width = 3375
End
Begin VB.TextBox txtPage
Height = 375
Left = 960
TabIndex = 9
Top = 2160
Width = 3015
End
Begin VB.TextBox txtPrice
Height = 375
Left = 5040
TabIndex = 8
Top = 2160
Width = 3255
End
Begin VB.ComboBox cboType
Height = 300
Left = 960
TabIndex = 6
Top = 960
Width = 3015
End
Begin VB.TextBox txtBookName
Height = 375
Left = 5040
TabIndex = 3
Top = 360
Width = 3375
End
Begin VB.TextBox txtBookID
BackColor = &H00FFFFFF&
Enabled = 0 'False
Height = 375
Left = 960
TabIndex = 1
Top = 360
Width = 3015
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "登记日期:"
ForeColor = &H00FF0000&
Height = 255
Left = 4200
TabIndex = 15
Top = 1680
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "作者姓名:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 13
Top = 1680
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "出版社:"
ForeColor = &H00FF0000&
Height = 255
Left = 4320
TabIndex = 12
Top = 1080
Width = 735
End
Begin VB.Label Label22
BackStyle = 0 'Transparent
Caption = "书籍页码:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 10
Top = 2280
Width = 855
End
Begin VB.Label Label26
BackStyle = 0 'Transparent
Caption = "书籍价格:"
ForeColor = &H00FF0000&
Height = 255
Left = 4200
TabIndex = 7
Top = 2280
Width = 855
End
Begin VB.Label Label24
BackStyle = 0 'Transparent
Caption = "书籍类别:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 5
Top = 1080
Width = 855
End
Begin VB.Label Label25
BackStyle = 0 'Transparent
Caption = "书籍名称:"
ForeColor = &H00FF0000&
Height = 255
Left = 4200
TabIndex = 4
Top = 480
Width = 855
End
Begin VB.Label Label27
BackStyle = 0 'Transparent
Caption = "书籍编号:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 2
Top = 480
Width = 975
End
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "取消"
ForeColor = &H000080FF&
Height = 255
Left = 5400
TabIndex = 18
Top = 3120
Width = 375
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "保存"
ForeColor = &H00FFFFC0&
Height = 255
Left = 3840
TabIndex = 17
Top = 3120
Width = 375
End
Begin VB.Image ImageClose
Height = 240
Left = 5880
Picture = "FrmUpdateBook.frx":329D1
Top = 3240
Width = 255
End
Begin VB.Image ImageSave
Height = 240
Left = 4320
Picture = "FrmUpdateBook.frx":32ED1
Top = 3240
Width = 225
End
End
Attribute VB_Name = "FrmUpdateBook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
End Sub
Private Sub cmdSave_Click()
End Sub
Private Sub Form_Load()
'在窗口打开的同时,进行控件的初始化
'对书籍的类别组合框进行初始化
dtpRigDate.Value = Date
Set g_rs = g_db.OpenRecordset("bookType", dbOpenTable)
cboType.Clear
If g_rs.RecordCount > 0 Then
g_rs.MoveFirst
Do While Not g_rs.EOF
cboType.AddItem g_rs!类别代码 + "-" + g_rs!书籍类别
g_rs.MoveNext
Loop
End If
Set g_rs = Nothing
'根据指定修改的书籍信息,对控件进行初始化
FrmBookManage.DataGrid1.Col = 0
txtBookID.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 1
txtBookName.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 2
cboType.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 3
txtBookConcern.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 4
txtWriter.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 5
txtPrice.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 6
txtPage.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 7
dtpRigDate.Value = FrmBookManage.DataGrid1.Text
Set g_rs = g_db.OpenRecordset("bookType", dbOpenTable)
If g_rs.RecordCount > 0 Then
g_rs.MoveFirst
Do While Not g_rs.EOF
If cboType.Text = g_rs!书籍类别 Then
cboType.Text = g_rs!类别代码 + "-" + g_rs!书籍类别
End If
g_rs.MoveNext
Loop
End If
Set g_rs = Nothing
End Sub
Private Sub ImageClose_Click()
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub
Private Sub ImageSave_Click()
'保存书籍修改信息
g_strSql = "select * from bookInfo where 书籍编号='" & txtBookID.Text & "'"
Set g_rs = g_db.OpenRecordset(g_strSql)
g_rs.Edit
'设置记录的字段值
g_rs!书籍名称 = txtBookName.Text
g_rs!类别代码 = Mid(cboType.Text, 1, 1)
g_rs!出版社 = txtBookConcern.Text
g_rs!作者姓名 = txtWriter.Text
g_rs!书籍价格 = txtPrice.Text
g_rs!书籍页码 = txtPage.Text
g_rs!登记日期 = dtpRigDate.Value
g_rs!是否借出 = False
'保存修改!!!
g_rs.Update
Set g_rs = Nothing
MsgBox "保存修改完毕!", vbOKOnly, "提示"
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -