?? operate.frm
字號:
VERSION 5.00
Begin VB.Form form2
BorderStyle = 1 'Fixed Single
Caption = "編輯學生信息"
ClientHeight = 3300
ClientLeft = 150
ClientTop = 435
ClientWidth = 4455
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3300
ScaleWidth = 4455
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command5
Caption = "退 出"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 9
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "刪 除"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 8
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "修 改"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 7
Top = 1560
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添 加"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 6
Top = 960
Width = 1095
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\My Documents\ZQH\VB\mis\mis.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "STUDENT"
Top = 2880
Width = 2655
End
Begin VB.Frame Frame1
Caption = "學生情況"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2655
Left = 120
TabIndex = 0
Top = 120
Width = 3015
Begin VB.TextBox Text5
DataField = "借閱量"
DataSource = "Data1"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 5
Top = 2160
Width = 735
End
Begin VB.TextBox Text4
DataField = "專業"
DataSource = "Data1"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.TextBox Text3
DataField = "班級"
DataSource = "Data1"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 3
Top = 1200
Width = 1215
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Data1"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 2
Top = 720
Width = 1575
End
Begin VB.TextBox Text1
DataField = "學號"
DataSource = "Data1"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 1
Top = 240
Width = 1815
End
Begin VB.Label Label2
Caption = "借閱量"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 240
TabIndex = 14
Top = 2280
Width = 855
End
Begin VB.Label Label2
Caption = "專業"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 240
TabIndex = 13
Top = 1800
Width = 855
End
Begin VB.Label Label2
Caption = "班級"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 240
TabIndex = 12
Top = 1320
Width = 855
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 240
TabIndex = 11
Top = 840
Width = 855
End
Begin VB.Label Label2
Caption = "學號"
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 240
TabIndex = 10
Top = 360
Width = 615
End
End
End
Attribute VB_Name = "form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DbStr As String
Private Sub Command1_Click() '進入添加STUDENT或BOOK數據表記錄的界面,或進入借書界面
flag2 = True '執行添加動作
If flag3 = True Then
Form3.Show 1
End If
If flag4 = True Then
Form4.Show 1
End If
End Sub
Private Sub Command2_Click() '進入修改STUDENT或BOOK數據表記錄的界面,或進入還書界面
flag2 = False '執行修改動作
If flag3 = True Then
Form3.Text1.Locked = True '控件鎖定,不能修改關鍵字,若要修改,則先刪除此項記錄再添加記錄
Form3.Show 1
End If
If flag4 = True Then
Form4.Text1.Locked = True
Form4.Show 1
End If
End Sub
Private Sub Command3_Click() '刪除記錄
Dim i As Integer
Dim result As Integer
If Not Data1.Recordset.EOF Or Data1.Recordset.BOF Then
result = MsgBox("當前記錄將被刪除", 48 + vbOKCancel, "警告")
If result = vbOK Then
Data1.Recordset.Delete
Data1.Update
End If
Else
rusult = MsgBox("無法刪除當前記錄", 48, "提示")
End If
End Sub
Private Sub Command5_Click() '退出
Unload Me
End Sub
Private Sub Form_Load() '窗體裝載
Data1.DatabaseName = App.Path + "\mis.mdb"
If flag3 = True Then
DbStr = "STUDENT" '引用學生數據表
Text1.DataField = "學號" '綁定數據字段
Text2.DataField = "姓名"
Text3.DataField = "班級"
Text4.DataField = "專業"
Text5.DataField = "借閱量"
Caption = "編輯學生信息" '編輯窗體界面
Frame1.Caption = "學生情況"
Label2(0).Caption = "學號"
Label2(1).Caption = "姓名"
Label2(2).Caption = "班級"
Label2(3).Caption = "專業"
Label2(4).Caption = "借閱量"
End If
If flag4 = True Then
DbStr = "BOOK" '引用圖書數據表
Text1.DataField = "書號" '綁定數據字段
Text2.DataField = "書名"
Text3.DataField = "著者"
Text4.DataField = "出版社"
Text5.DataField = "標志"
Caption = "編輯圖書信息" '編輯窗體
Frame1.Caption = "圖書情況"
Label2(0).Caption = "書號"
Label2(1).Caption = "書名"
Label2(2).Caption = "著者"
Label2(3).Caption = "出版社"
Label2(4).Caption = "標志"
Text4.Width = form2.Text2.Width
Text2.Width = form2.Text1.Width
Text3.Width = form2.Text4.Width
End If
If flag5 = True Then
DbStr = "STUDBR" '引用借還書數據表
Text1.DataField = "書號" '綁定數據字段
Text2.DataField = "學號"
Text3.DataField = "書名"
Text4.DataField = "借閱日期"
Text5.DataField = "應還日期"
Caption = "編輯借還書檔案" '編輯窗體
Frame1.Caption = "借還書情況"
Label2(0).Caption = "書號"
Label2(1).Caption = "學號"
Label2(2).Caption = "書名"
Label2(3).Caption = "借閱日期"
Label2(4).Caption = "應還日期"
Text3.Width = form2.Text2.Width
Text1.Width = form2.Text2.Width
Text5.Width = form2.Text4.Width
Command1.Visible = False
Command2.Visible = False
End If
Data1.RecordSource = DbStr
'更新數據庫
Data1.Refresh
Data1.Caption = DbStr
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -