📄 frmbookaddinfo.frm
字号:
Left = -74640
TabIndex = 41
Top = 1639
Width = 900
End
Begin VB.Label Label18
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备 注:"
Height = 180
Left = -74640
TabIndex = 40
Top = 4440
Width = 900
End
Begin VB.Label Label17
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "内容简介:"
Height = 180
Left = -74640
TabIndex = 39
Top = 2604
Width = 900
End
Begin VB.Label Label16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版日期:"
Height = 180
Left = -74640
TabIndex = 38
Top = 2170
Width = 900
End
Begin VB.Label Label14
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "库存总量:"
Height = 180
Left = -74640
TabIndex = 36
Top = 1108
Width = 900
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "现 存 量:"
Height = 180
Left = -74640
TabIndex = 35
Top = 570
Width = 900
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书价格:"
Height = 180
Left = 360
TabIndex = 34
Top = 5850
Width = 900
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书页数:"
Height = 180
Left = 360
TabIndex = 33
Top = 5370
Width = 900
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版地点:"
Height = 180
Left = 360
TabIndex = 31
Top = 4890
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版社名:"
Height = 180
Left = 360
TabIndex = 29
Top = 4410
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "译 者:"
Height = 180
Left = 360
TabIndex = 28
Top = 3930
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "作 者:"
Height = 180
Left = 360
TabIndex = 27
Top = 3450
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "书架位置:"
Height = 180
Left = 360
TabIndex = 26
Top = 2970
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别名称:"
Height = 180
Left = 360
TabIndex = 24
Top = 2490
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别编号:"
Height = 180
Left = 360
TabIndex = 22
Top = 2010
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "标准ISBN:"
Height = 180
Left = 360
TabIndex = 21
Top = 1530
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书名称:"
Height = 180
Left = 360
TabIndex = 20
Top = 1050
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书编号:"
Height = 180
Left = 360
TabIndex = 19
Top = 577
Width = 900
End
End
Begin VB.PictureBox Picbg1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 1440
Left = 6360
Picture = "frmbookaddinfo.frx":1989A
ScaleHeight = 1440
ScaleWidth = 1440
TabIndex = 44
Top = 600
Width = 1440
End
Begin VB.Shape Shape1
BackColor = &H8000000F&
BorderColor = &H8000000A&
Height = 2655
Left = 6360
Top = 3480
Width = 1455
End
End
Attribute VB_Name = "frmbookaddinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-------------------------------------------------------
' 作者:龙茂春
' 功能:添加图书信息
'-------------------------------------------------------
Private Sub cmdclear_Click()
txt图书编号.Text = ""
txt图书名称.Text = ""
txtISBN.Text = ""
txt类别编号.Text = ""
txt类别名称.Text = ""
txt书架位置.Text = ""
txt作者.Text = ""
txt译者.Text = ""
txt出版社名.Text = ""
txt出版地点.Text = ""
txt图书页数.Text = Val("")
txt图书价格.Text = Format(Val(""), "0.00")
txt现存量.Text = Val("")
txt库存总量.Text = Val("")
DTP入库日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
DTP出版日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
txt内容简介.Text = ""
txt备注.Text = ""
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from tsxxb"
Dim sql2 As String
sql2 = "select * from tsxxb where 图书编号 ='" & txt图书编号.Text & "'"
If Trim(txt图书编号.Text) = "" Then
MsgBox "图书编号不能为空!", vbOKOnly
ElseIf Trim(txt图书名称.Text) = "" Then
MsgBox "图书名称不能为空!", vbOKOnly
Else
Set rs = TransactSQL(sql2)
If rs.EOF = False Then
MsgBox "该编号图书已经存在,请核对!", vbOKOnly
rs.Close
Else
Set rs = TransactSQL(sql)
rs.AddNew '添加新纪录
rs.Fields(0) = Trim(txt图书编号.Text)
rs.Fields(1) = Trim(txt图书名称.Text)
rs.Fields(2) = Trim(txtISBN.Text)
rs.Fields(3) = Trim(txt类别编号.Text)
rs.Fields(4) = Trim(txt类别名称.Text)
rs.Fields(5) = Trim(txt书架位置.Text)
rs.Fields(6) = Trim(txt作者.Text)
rs.Fields(7) = Trim(txt译者.Text)
rs.Fields(8) = Trim(txt出版社名.Text)
rs.Fields(9) = Trim(txt出版地点.Text)
rs.Fields(10) = Val(txt图书页数.Text)
rs.Fields(11) = Val(txt图书价格.Text)
rs.Fields(12) = Val(txt现存量.Text)
rs.Fields(13) = Val(txt库存总量.Text)
rs.Fields(14) = 0
rs.Fields(15) = "否"
rs.Fields(16) = DTP入库日期.Value
rs.Fields(17) = DTP出版日期.Value
rs.Fields(18) = Trim(txt内容简介.Text)
rs.Fields(19) = Trim(txt备注.Text)
rs.Fields(20) = user
rs.Update
MsgBox "图书添加成功!", vbOKOnly
rs.Close
Call frmbookmanage.bookone_update(Trim(txt图书编号.Text), True) '更新bookGrid表
frmbookmanage.bookGrid.Refresh
End If
End If
End Sub
Private Sub cmd出版社选择_Click()
Dim sql As String
sql = "select * from cbslbb"
If TransactSQL(sql).EOF Then
MsgBox "请到出版社资料管理添加出版社资料,再继续录入图书信息。", vbOKOnly
Else
frmbookmanage.bookinfo = False
frmbookinfo_choose.Show 1
End If
End Sub
Private Sub cmd类别选择_Click()
Dim sql As String
sql = "select * from tslbb"
If TransactSQL(sql).EOF Then
MsgBox "请到书籍类别管理添加书籍类别,再继续录入图书信息。", vbOKOnly
Else
frmbookmanage.bookinfo = True
frmbookinfo_choose.Show 1
End If
End Sub
Private Sub Form_Load()
Call fullpic(Me, Picbg1) '背景图
Me.Left = (frmmain.ScaleWidth - Me.Width) / 2
Me.Top = (frmmain.ScaleHeight - Me.Height) / 2
frmbookmanage.bookflag = True '表示是添加窗体
DTP入库日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
DTP出版日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
End Sub
Private Sub txt图书价格_Change()
If Not IsNumeric(txt图书价格.Text) And txt图书价格.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt图书价格.Text = Format(Val(""), "0.00")
End If
End Sub
Private Sub txt图书页数_Change()
If Not IsNumeric(txt图书页数.Text) And txt图书页数.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt图书页数.Text = Val("")
End If
End Sub
Private Sub txt现存量_Change()
If Not IsNumeric(txt现存量.Text) And txt图书页数.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt现存量.Text = Val("")
txt库存总量.Text = Val("")
Else
txt库存总量.Text = txt现存量.Text
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -