📄 tsxxgl.frm
字号:
VERSION 5.00
Begin VB.Form tsgl
Caption = "Form2"
ClientHeight = 4665
ClientLeft = 60
ClientTop = 345
ClientWidth = 7635
LinkTopic = "Form2"
ScaleHeight = 4665
ScaleWidth = 7635
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command9
Caption = "取消"
Height = 375
Left = 6840
TabIndex = 21
Top = 3240
Width = 735
End
Begin VB.CommandButton Command8
Caption = "确定"
Height = 375
Left = 6000
TabIndex = 20
Top = 3240
Width = 735
End
Begin VB.CommandButton Command7
Caption = "删除"
Height = 375
Left = 5160
TabIndex = 19
Top = 3240
Width = 735
End
Begin VB.CommandButton Command6
Caption = "添加"
Height = 375
Left = 4320
TabIndex = 18
Top = 3240
Width = 735
End
Begin VB.CommandButton Command5
Caption = "修改"
Height = 375
Left = 3480
TabIndex = 17
Top = 3240
Width = 735
End
Begin VB.CommandButton Command4
Caption = "未记录"
Height = 375
Left = 2640
TabIndex = 16
Top = 3240
Width = 735
End
Begin VB.CommandButton Command3
Caption = "后移"
Height = 375
Left = 1800
TabIndex = 15
Top = 3240
Width = 735
End
Begin VB.CommandButton Command2
Caption = "前移"
Height = 375
Left = 960
TabIndex = 14
Top = 3240
Width = 735
End
Begin VB.CommandButton Command1
Caption = "首记录"
Height = 375
Left = 120
TabIndex = 13
Top = 3240
Width = 735
End
Begin VB.TextBox Text6
DataField = "册数"
DataSource = "Data1"
Height = 375
Left = 4080
TabIndex = 12
Text = "Text6"
Top = 2160
Width = 1575
End
Begin VB.TextBox Text5
DataField = "单价"
DataSource = "Data1"
Height = 375
Left = 1560
TabIndex = 10
Text = "Text5"
Top = 2160
Width = 1215
End
Begin VB.TextBox Text4
DataField = "出版社"
DataSource = "Data1"
Height = 375
Left = 4080
MaxLength = 20
TabIndex = 8
Text = "Text4"
Top = 1560
Width = 2535
End
Begin VB.TextBox Text3
DataField = "作者"
DataSource = "Data1"
Height = 375
Left = 1560
MaxLength = 8
TabIndex = 5
Text = "Text3"
Top = 1560
Width = 1215
End
Begin VB.TextBox Text2
DataField = "书名"
DataSource = "Data1"
Height = 375
Left = 4080
MaxLength = 20
TabIndex = 3
Text = "Text2"
Top = 960
Width = 1335
End
Begin VB.TextBox Text1
DataField = "书号"
DataSource = "Data1"
Height = 375
Left = 1560
MaxLength = 6
TabIndex = 1
Text = "Text1"
Top = 960
Width = 1095
End
Begin VB.Data Data1
BOFAction = 1 'BOF
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
EOFAction = 1 'EOF
Exclusive = 0 'False
Height = 345
Left = 4200
Negotiate = -1 'True
Options = 0
ReadOnly = 0 'False
RecordsetType = 0 'Table
RecordSource = ""
Top = 4200
Width = 2055
End
Begin VB.Label Label7
Caption = "册数:"
Height = 375
Left = 3240
TabIndex = 11
Top = 2160
Width = 735
End
Begin VB.Label Label6
Caption = "单价:"
Height = 375
Left = 720
TabIndex = 9
Top = 2160
Width = 735
End
Begin VB.Label Label5
Caption = "出版社:"
Height = 375
Left = 3240
TabIndex = 7
Top = 1560
Width = 855
End
Begin VB.Label Label4
Caption = "作者:"
Height = 255
Left = 720
TabIndex = 6
Top = 1560
Width = 615
End
Begin VB.Label Label3
Caption = "书名:"
Height = 375
Left = 3240
TabIndex = 4
Top = 960
Width = 735
End
Begin VB.Label Label2
Caption = "书号:"
Height = 375
Left = 720
TabIndex = 2
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "图书信息维护"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 2640
TabIndex = 0
Top = 120
Width = 2415
End
End
Attribute VB_Name = "tsgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sg As Boolean
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
Command4.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
End Sub
Private Sub Command2_Click()
Data1.Recordset.MovePrevious
Command3.Enabled = True
Command4.Enabled = True
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
Command4.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
End If
End Sub
Private Sub Command3_Click()
Data1.Recordset.MoveNext
Command1.Enabled = True
Command2.Enabled = True
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
End If
End Sub
Private Sub Command4_Click()
Data1.Recordset.MoveLast
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
End Sub
Private Sub Command5_Click()
sg = True
Call ee
Data1.Recordset.Edit
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command8.Enabled = True
Command9.Enabled = True
End Sub
Private Sub Command6_Click()
sg = False
Data1.Recordset.AddNew
Call empt
Call ee
Text1.SetFocus
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command8.Enabled = True
Command9.Enabled = True
End Sub
Private Sub Command7_Click()
Data1.Recordset.Delete
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
Else
Data1.Recordset.MoveNext
End If
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
MsgBox "这是表中的最后一条记录"
End If
If Data1.Recordset.EOF Or Data1.Recordset.BOF Then
Command7.Enabled = False
Else
Command7.Enabled = True
End If
End Sub
Private Sub Command8_Click()
Data1.Recordset.Update
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
Call ne
End Sub
Private Sub Command9_Click()
Data1.UpdateControls
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
Call ne
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
If Data1.Recordset.EOF Or Data1.Recordset.BOF Then
Command7.Enabled = False
Else
Command7.Enabled = True
End If
End Sub
Private Sub Form_Activate()
Command8.Enabled = False
Command9.Enabled = False
If Data1.Recordset.EOF And Data1.Recordset.BOF Then
Call empt
End If
Call ne
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\tsglxx.mdb"
Data1.RecordSource = "tsxx"
End Sub
Private Sub ne()
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
End Sub
Private Sub ee()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
End Sub
Private Sub empt()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command7.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -