📄 所购图书.frm
字号:
VERSION 5.00
Begin VB.Form 所购图书
BorderStyle = 1 'Fixed Single
Caption = "购买的图书"
ClientHeight = 4620
ClientLeft = 4305
ClientTop = 4050
ClientWidth = 6210
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4620
ScaleWidth = 6210
Begin VB.ListBox List1
DataField = "所购书籍"
DataSource = "Data1"
Enabled = 0 'False
Height = 1860
ItemData = "所购图书.frx":0000
Left = 1080
List = "所购图书.frx":0002
Sorted = -1 'True
TabIndex = 3
Top = 1920
Width = 2295
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "图书系统.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 1800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "购书统计"
Top = 4080
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3720
TabIndex = 2
Top = 3120
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "记帐确认"
Height = 495
Left = 3720
TabIndex = 1
Top = 2040
Width = 1215
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "您所选的图书为"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 975
Left = 1200
TabIndex = 0
Top = 600
Width = 3975
End
End
Attribute VB_Name = "所购图书"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim b
Data1.Recordset.MoveFirst
Do While Data1.Recordset.EOF <> True
b = b + Data1.Recordset.Fields(2)
Data1.Recordset.MoveNext
Loop
MsgBox "金额总计 " & b & " 元 ", vbOKOnly, "统计"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Data1.Refresh
Data1.Recordset.MoveFirst
Do While Data1.Recordset.EOF <> True
List1.AddItem Data1.Recordset.Fields(1)
Data1.Recordset.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -