📄 edbook1.frm
字号:
VERSION 5.00
Begin VB.Form edbook1
Caption = "编辑图书中心"
ClientHeight = 4515
ClientLeft = 60
ClientTop = 435
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4515
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmd_cancel
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 14
Top = 4080
Width = 1215
End
Begin VB.CommandButton cmd_ok
Caption = "确定"
Height = 375
Left = 600
TabIndex = 13
Top = 4080
Width = 1095
End
Begin VB.Frame Frame1
Caption = "图书记录"
Height = 3735
Left = 360
TabIndex = 0
Top = 240
Width = 4215
Begin VB.TextBox txtprice
Height = 375
Left = 1560
TabIndex = 16
Text = "Text1"
Top = 2520
Width = 1695
End
Begin VB.ComboBox cmbpublish
Height = 300
ItemData = "edbook1.frx":0000
Left = 1560
List = "edbook1.frx":000A
TabIndex = 15
Text = "Combo1"
Top = 2040
Width = 1695
End
Begin VB.TextBox txtdata
Height = 375
Left = 1560
TabIndex = 11
Text = "Text6"
Top = 3000
Width = 1695
End
Begin VB.TextBox txtauthor
Height = 375
Left = 1560
TabIndex = 10
Text = "Text4"
Top = 1560
Width = 1695
End
Begin VB.TextBox txtname
Height = 375
Left = 1560
TabIndex = 9
Text = "Text3"
Top = 1080
Width = 1695
End
Begin VB.TextBox txtsortno
Height = 375
Left = 1560
TabIndex = 8
Text = "Text2"
Top = 600
Width = 1695
End
Begin VB.TextBox txtno
Height = 375
Left = 1560
TabIndex = 7
Text = "Text1"
Top = 120
Width = 1695
End
Begin VB.Label Label8
Caption = "入库日期*"
Height = 375
Left = 600
TabIndex = 17
Top = 3000
Width = 855
End
Begin VB.Label Label7
Caption = "日期格式:yy-mm-dd"
Height = 375
Left = 480
TabIndex = 12
Top = 3480
Width = 2895
End
Begin VB.Label Label6
Caption = "定 价"
Height = 255
Left = 600
TabIndex = 6
Top = 2640
Width = 855
End
Begin VB.Label Label5
Caption = "出 版 社"
Height = 255
Left = 600
TabIndex = 5
Top = 2040
Width = 855
End
Begin VB.Label Label4
Caption = " 作 者*"
Height = 495
Left = 480
TabIndex = 4
Top = 1680
Width = 975
End
Begin VB.Label Label3
Caption = "书 名*"
Height = 375
Left = 600
TabIndex = 3
Top = 1200
Width = 855
End
Begin VB.Label Label2
Caption = "分 类 号"
Height = 495
Left = 600
TabIndex = 2
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "图书编号*"
Height = 375
Left = 600
TabIndex = 1
Top = 240
Width = 855
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 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("定价") & ""
txtdata.Text = edbook.Adodc1.Recordset.Fields("入库日期") & ""
txtno.Enabled = False
Else
txtdata.Text = Data
End If
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 flaf = 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(txtdata.Text), "yyyy-mm-dd")
edbook.Adodc1.Recordset.Fields("借否") = "否"
edbook.Adodc1.Recordset.Update
resc = resc + 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(txtdata.Text), "yyyy-mm-dd")
edbook.Adodc1.Recordset.Fields("借否") = "否"
edbook.Adodc1.Recordset.Update
End If
unloade Me
End Sub
Private Sub cmd_cancel_click()
Unload Me
End Sub
Private Sub txtno_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub txtsortno_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub txtname_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub txtauthor_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub cmbpublish_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub txtprice_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
Private Sub txtdata_keypress(keyascii As Integer)
Call endata(keyascii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -