📄 edbook1.frm
字号:
VERSION 5.00
Begin VB.Form edbook1
Caption = "编辑图书记录"
ClientHeight = 8130
ClientLeft = 60
ClientTop = 465
ClientWidth = 8190
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8130
ScaleWidth = 8190
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_cancel
Caption = "取消"
Height = 615
Left = 4320
TabIndex = 17
Top = 7080
Width = 1575
End
Begin VB.CommandButton cmd_ok
Caption = "确定"
Height = 615
Left = 1200
TabIndex = 16
Top = 7080
Width = 1575
End
Begin VB.Frame frame1
Caption = "图书记录"
Height = 6135
Left = 360
TabIndex = 0
Top = 600
Width = 7215
Begin VB.ComboBox cmbpublish
Height = 300
ItemData = "edbook1.frx":0000
Left = 2400
List = "edbook1.frx":000A
TabIndex = 14
Text = "高等出版社"
Top = 3720
Width = 2175
End
Begin VB.TextBox txtdate
Height = 375
Left = 2400
MaxLength = 10
TabIndex = 13
Top = 5280
Width = 2175
End
Begin VB.TextBox txtprice
Height = 375
Left = 2400
MaxLength = 9
TabIndex = 12
Top = 4465
Width = 2175
End
Begin VB.TextBox txtauthor
Height = 375
Left = 2400
MaxLength = 16
TabIndex = 11
Top = 2880
Width = 2535
End
Begin VB.TextBox txtname
Height = 375
Left = 2400
MaxLength = 40
TabIndex = 10
Top = 2104
Width = 4215
End
Begin VB.TextBox txtsortno
Height = 345
Left = 2400
MaxLength = 3
TabIndex = 9
Top = 1292
Width = 2295
End
Begin VB.TextBox txtno
Height = 375
Left = 2400
MaxLength = 4
TabIndex = 8
Top = 480
Width = 2295
End
Begin VB.Label Label8
Caption = "日期格式: yy-mm-dd"
Height = 375
Left = 4800
TabIndex = 15
Top = 5280
Width = 1935
End
Begin VB.Label Label7
Caption = "入库日期*"
Height = 375
Left = 840
TabIndex = 7
Top = 5400
Width = 1095
End
Begin VB.Label Label6
Caption = "定价"
Height = 375
Left = 840
TabIndex = 6
Top = 4575
Width = 1095
End
Begin VB.Label Label5
Caption = "出版社"
Height = 375
Left = 840
TabIndex = 5
Top = 3765
Width = 1095
End
Begin VB.Label Label4
Caption = "作者*"
Height = 375
Left = 840
TabIndex = 4
Top = 2940
Width = 1095
End
Begin VB.Label Label3
Caption = "书名*"
Height = 375
Left = 840
TabIndex = 3
Top = 2115
Width = 1095
End
Begin VB.Label Label2
Caption = "分类号"
Height = 375
Left = 840
TabIndex = 2
Top = 1305
Width = 1095
End
Begin VB.Label Label1
Caption = "图书编号*"
Height = 375
Left = 840
TabIndex = 1
Top = 480
Width = 1095
End
End
End
Attribute VB_Name = "edbook1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbpublish_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub cmd_cancel_Click()
Unload Me
End Sub
Private Sub cmd_ok_Click()
If Trim(txtno.Text) = "" Or Trim(txtname.Text) = "" Or Trim(txtauthor.Text) = "" Or Trim(txtprice.Text) = "" Then
MsgBox "加*数据不能为空,请重新设置", vbOKOnly, "信息提示"
Exit Sub
End If
If flag = 1 Then
edbook.Adodc1.Recordset.AddNew
edbook.Adodc1.Recordset.Fields("图书编号") = Trim(txtno.Text)
edbook.Adodc1.Recordset.Fields("分类号") = Trim(txtsortno.Text)
edbook.Adodc1.Recordset.Fields("书名") = Trim(txtname.Text)
edbook.Adodc1.Recordset.Fields("作者") = Trim(txtauthor.Text)
edbook.Adodc1.Recordset.Fields("出版社") = Trim(cmbpublish.Text)
edbook.Adodc1.Recordset.Fields("定价") = Val(Trim(txtprice.Text))
edbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(txtdate.Text), "yyyy-mm-dd")
edbook.Adodc1.Recordset.Fields("借否") = "否"
edbook.Adodc1.Recordset.Update
recs = recs + 1
Else
edbook.Adodc1.Recordset.Fields("图书编号") = Trim(txtno.Text)
edbook.Adodc1.Recordset.Fields("分类号") = Trim(txtsortno.Text)
edbook.Adodc1.Recordset.Fields("书名") = Trim(txtname.Text)
edbook.Adodc1.Recordset.Fields("作者") = Trim(txtauthor.Text)
edbook.Adodc1.Recordset.Fields("出版社") = Trim(cmbpublish.Text)
edbook.Adodc1.Recordset.Fields("定价") = Val(Trim(txtprice.Text))
edbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(txtdate.Text), "yyyy-mm-dd")
edbook.Adodc1.Recordset.Fields("借否") = "否"
edbook.Adodc1.Recordset.Update
End If
Unload Me
End Sub
Private Sub Form_Load()
If flag = 2 Then
txtno.Text = edbook.Adodc1.Recordset.Fields("图书编号") & ""
txtsortno.Text = edbook.Adodc1.Recordset.Fields("分类号") & ""
txtname.Text = edbook.Adodc1.Recordset.Fields("书名") & ""
txtauthor.Text = edbook.Adodc1.Recordset.Fields("作者") & ""
cmbpublish.Text = edbook.Adodc1.Recordset.Fields("出版社") & ""
txtprice.Text = edbook.Adodc1.Recordset.Fields("定价") & ""
txtdate.Text = edbook.Adodc1.Recordset.Fields("入库日期") & ""
txtno.Enabled = False
Else
txtdate.Text = Date
End If
End Sub
Private Sub txtauthor_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtdate_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtno_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtxname_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtprice_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtsortno_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -