?? editbook.frm
字號:
VERSION 5.00
Begin VB.Form Form4
BorderStyle = 1 'Fixed Single
Caption = "圖書信息輸入"
ClientHeight = 3060
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
BeginProperty Font
Name = "Times New Roman"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 3480
TabIndex = 11
Top = 2520
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 375
Left = 3480
TabIndex = 10
Top = 1920
Width = 1095
End
Begin VB.Frame Frame1
Caption = "圖書情況"
Height = 2775
Left = 120
TabIndex = 0
Top = 120
Width = 3255
Begin VB.ComboBox Combo1
Height = 345
Left = 840
Style = 2 'Dropdown List
TabIndex = 12
Top = 2280
Width = 1095
End
Begin VB.TextBox Text4
Height = 375
Left = 840
TabIndex = 9
Top = 1680
Width = 1935
End
Begin VB.TextBox Text3
Height = 375
Left = 840
TabIndex = 8
Top = 1200
Width = 1455
End
Begin VB.TextBox Text2
Height = 375
Left = 840
TabIndex = 7
Top = 720
Width = 2295
End
Begin VB.TextBox Text1
Height = 375
Left = 840
TabIndex = 6
Top = 240
Width = 1815
End
Begin VB.Label Label1
Caption = "書 名"
Height = 375
Index = 4
Left = 120
TabIndex = 5
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "著 者"
Height = 375
Index = 3
Left = 120
TabIndex = 4
Top = 1320
Width = 735
End
Begin VB.Label Label1
Caption = "出 版 社"
Height = 375
Index = 2
Left = 120
TabIndex = 3
Top = 1800
Width = 735
End
Begin VB.Label Label1
Caption = "標 志"
Height = 375
Index = 1
Left = 120
TabIndex = 2
Top = 2280
Width = 735
End
Begin VB.Label Label1
Caption = "書 號"
Height = 375
Index = 0
Left = 120
TabIndex = 1
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private num As String
Private Sub Command1_Click() '確定
Dim result As Integer
Dim i, J As Integer
'排錯處理
If Text1.text = "" Then
result = MsgBox("書號欄空!", 48, "提示")
Exit Sub
End If
If Text2.text = "" Then
result = MsgBox("書名欄空!", 48, "提示")
Exit Sub
End If
If Text3.text = "" Then
result = MsgBox("著者欄空!", 48, "提示")
Exit Sub
End If
If Text4.text = "" Then
result = MsgBox("出版社欄空!", 48, "提示")
Exit Sub
End If
If Combo1.text = "" Then
result = MsgBox("標志欄欄空!", 48, "提示")
Exit Sub
End If
'增加記錄時,檢驗關鍵字是否已存在
If flag2 = True Then
form2.Data1.Recordset.MoveLast
form2.Data1.Recordset.MoveFirst
For J = 1 To form2.Data1.Recordset.RecordCount
If form2.Data1.Recordset.Fields(0) = Text1.text Then
result = MsgBox("此號已存在,請重新輸入!", 48, "提示")
Exit Sub
End If
form2.Data1.Recordset.MoveNext
Next J
End If
If flag2 = True Then '添加新記錄
form2!Data1.Recordset.AddNew
Else '修改記錄
form2!Data1.Recordset.Edit
End If
form2.Data1.Recordset.Fields(0) = Text1.text
form2.Data1.Recordset.Fields(1) = Text2.text
form2.Data1.Recordset.Fields(2) = Text3.text
form2.Data1.Recordset.Fields(3) = Text4.text
form2.Data1.Recordset.Fields(4) = Combo1.text
form2.Data1.Recordset.Update '更新記錄
form2.Data1.Refresh '更新數據庫
Unload Form4
End Sub
Private Sub Command2_Click() '退出
Unload Me
End Sub
Private Sub Form_Load() '窗體裝載
Combo1.AddItem "可借"
Combo1.AddItem "不可借"
If flag2 = True Then
Text1.text = "" '添加操作時,對調入界面的初始化
Text2.text = ""
Text3.text = ""
Text4.text = ""
Combo1.text = "可借"
Else
num = form2.Data1.Recordset.Fields(0)
Text1.text = form2.Data1.Recordset.Fields(0) '修改操作時,對調入界面的初始化
Text2.text = form2.Data1.Recordset.Fields(1)
Text3.text = form2.Data1.Recordset.Fields(2)
Text4.text = form2.Data1.Recordset.Fields(3)
Combo1.text = form2.Data1.Recordset.Fields(4)
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -