📄 addbook.frm
字号:
VERSION 5.00
Begin VB.Form addbook
BorderStyle = 1 'Fixed Single
Caption = "添加图书"
ClientHeight = 5460
ClientLeft = 6450
ClientTop = 3675
ClientWidth = 6585
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5460
ScaleWidth = 6585
Begin VB.CommandButton Command2
BackColor = &H8000000D&
Caption = "添加(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1155
Style = 1 'Graphical
TabIndex = 18
Top = 4830
Width = 1335
End
Begin VB.CommandButton Command1
BackColor = &H8000000D&
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3990
Style = 1 'Graphical
TabIndex = 17
Top = 4830
Width = 1335
End
Begin VB.Frame Frame1
Caption = "新书基本信息"
Height = 4335
Index = 0
Left = 105
TabIndex = 1
Top = 105
Width = 6375
Begin VB.TextBox Text6
Height = 330
Left = 1365
TabIndex = 15
Text = "Text6"
Top = 2100
Width = 1485
End
Begin VB.TextBox Text5
Height = 330
Left = 1680
TabIndex = 14
Text = "Text5"
Top = 2940
Width = 2640
End
Begin VB.TextBox Text4
Height = 330
Left = 4200
TabIndex = 13
Text = "Text4"
Top = 2160
Width = 1590
End
Begin VB.TextBox Text3
Height = 330
Left = 4200
TabIndex = 12
Text = "Text3"
Top = 1275
Width = 1590
End
Begin VB.TextBox Text2
Height = 330
Left = 1260
TabIndex = 11
Text = "Text2"
Top = 1260
Width = 1590
End
Begin VB.TextBox Text1
Height = 330
Left = 2100
TabIndex = 10
Text = "Text1"
Top = 555
Width = 1905
End
Begin VB.Frame Frame2
Height = 855
Index = 0
Left = 315
TabIndex = 2
Top = 3360
Width = 5775
Begin VB.TextBox Text7
Appearance = 0 'Flat
BackColor = &H000040C0&
Height = 270
Left = 3360
TabIndex = 20
Text = "在库"
Top = 480
Width = 435
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "图书"
Height = 180
Left = 3885
TabIndex = 22
Top = 525
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "新增加的图书一律为"
Height = 180
Left = 1680
TabIndex = 21
Top = 525
Width = 1620
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "** 请将以上信息填写完整,以便日后查询 **"
ForeColor = &H00C000C0&
Height = 180
Index = 0
Left = 1050
TabIndex = 3
Top = 210
Width = 3780
End
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "格式:2005-8-8"
Height = 180
Left = 4515
TabIndex = 19
Top = 3045
Width = 1260
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "元"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 5880
TabIndex = 16
Top = 2205
Width = 255
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "入库时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 0
Left = 315
TabIndex = 9
Top = 3000
Width = 1020
End
Begin VB.Image Image1
Height = 480
Index = 0
Left = 4800
Picture = "addbook.frx":0000
Top = 480
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "出版社"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 4
Left = 315
TabIndex = 8
Top = 2160
Width = 780
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "类 别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 3
Left = 3255
TabIndex = 7
Top = 1320
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "价 格"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 2
Left = 3255
TabIndex = 6
Top = 2205
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "书 名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 1
Left = 315
TabIndex = 5
Top = 1320
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "输入图书编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 240
Index = 0
Left = 315
TabIndex = 4
Top = 600
Width = 1545
End
End
Begin VB.Frame Frame2
Height = 135
Index = 2
Left = 315
TabIndex = 0
Top = 4515
Width = 5895
End
End
Attribute VB_Name = "addbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
On Error GoTo nore
If MsgBox("确实要添加吗?", vbYesNo + vbQuestion, "提示") = vbYes Then
Call upD
rst.Update
MsgBox "添加成功"
End If
Exit Sub
nore:
MsgBox "图书编号重复或者输入错误!", vbOKOnly + vbCritical, "提示"
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
On Error GoTo fmerr
If QueryData("select * from book") = True Then
Else
MsgBox "查询失败!"
End If
Exit Sub
fmerr:
If rst.BOF = True And rst.EOF = True Then
MsgBox "没有任何记录!"
End If
End Sub
Private Sub upD()
rst.AddNew
rst.Fields(0).Value = Text1.Text
rst.Fields(1).Value = Text2.Text
rst.Fields(2).Value = Text3.Text
rst.Fields(3).Value = Text4.Text
rst.Fields(4).Value = Text7.Text
rst.Fields(5).Value = Text6.Text
rst.Fields(6).Value = Text5.Text
rst.Update
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -