?? formupdata.frm
字號:
End
Begin VB.Label Label9
Caption = "單 位"
Height = 240
Left = -74775
TabIndex = 21
Top = 1440
Width = 945
End
Begin VB.Label Label8
Caption = "姓 名"
Height = 240
Left = -74760
TabIndex = 19
Top = 975
Width = 900
End
Begin VB.Label Label7
Caption = "請輸入學(xué)號"
Height = 195
Left = -74775
TabIndex = 17
Top = 555
Width = 915
End
Begin VB.Image Image2
Height = 210
Left = -71070
Picture = "Formupdata.frx":0DD4
ToolTipText = "點擊搜索"
Top = 525
Width = 450
End
Begin VB.Image Image1
Height = 210
Left = 3930
Picture = "Formupdata.frx":1320
ToolTipText = "點擊搜索"
Top = 525
Width = 450
End
Begin VB.Label Label6
Caption = "簡 介"
Height = 210
Left = 330
TabIndex = 10
Top = 2175
Width = 450
End
Begin VB.Label Label5
Caption = "出版社"
Height = 270
Left = 315
TabIndex = 9
Top = 1785
Width = 705
End
Begin VB.Label Label4
Caption = "類 別"
Height = 210
Left = 2355
TabIndex = 7
Top = 1380
Width = 450
End
Begin VB.Label Label3
BackColor = &H80000004&
Caption = "作 者"
Height = 255
Left = 300
TabIndex = 5
Top = 1365
Width = 465
End
Begin VB.Label Label2
Caption = "書 名"
Height = 210
Left = 300
TabIndex = 3
Top = 975
Width = 885
End
Begin VB.Label Label1
Caption = "請輸入書號:"
Height = 255
Left = 255
TabIndex = 2
Top = 555
Width = 1095
End
End
End
Attribute VB_Name = "Formupdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*****************************************
'記錄更新窗體
'****************************************
'所調(diào)用的API函數(shù),自定義過程,類型,常數(shù)請參閱相應(yīng)模塊
Option Explicit
'Dim rcdset As Recordset '窗體級變量,ADO控件的當前記錄
Private Sub Form_Load()
loadmdb Adodc1 '連接 數(shù)據(jù)庫
End Sub
'更新書籍記錄
'確定要更新的記錄
Private Sub Image1_Click()
If Text1.Enabled = False Then
Text1.Enabled = True
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Combo1.Enabled = False
Command1.Enabled = False
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Exit Sub
Else
lockrecord Adodc1, "書籍總表", "書號", Text1.Text
Set rcdset = Adodc1.Recordset
If rcdset.RecordCount = 0 Then
MsgBox "無該記錄或輸入數(shù)據(jù)有誤。請查正。"
Exit Sub
Else
Text2.Text = rcdset!書名
Text3.Text = rcdset!作者
Combo1.Text = rcdset!類別
Combo1.Enabled = True
Text4.Text = rcdset!出版社
Text5.Text = "" & rcdset!簡介
Text1.Enabled = False
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Command1.Enabled = True
End If
End If
End Sub
'執(zhí)行更新書籍記錄操作
Private Sub Command1_Click()
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Combo1.Text = "" Then
MsgBox "請完整填寫必要字段,簡介可不填。"
Exit Sub
Else
rcdset!書名 = Text2.Text
rcdset!作者 = Text3.Text
rcdset!類別 = Combo1.Text
rcdset!出版社 = Text4.Text
rcdset!簡介 = Text5.Text
rcdset.update
Adodc1.Refresh
MsgBox "更新記錄成功。"
Command1.Enabled = False
Text1.Enabled = True
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Combo1.Enabled = False
End If
End Sub
'更新學(xué)生記錄
'確定要更新的記錄
Private Sub Image2_Click()
If Text6.Enabled = False Then
Text6.Enabled = True
Text7.Enabled = False
Text8.Enabled = False
Combo2.Enabled = False
Command4.Enabled = False
Text7.Text = ""
Text8.Text = ""
Combo2.Text = ""
Exit Sub
Else
lockrecord Adodc1, "學(xué)生總表", "學(xué)號", Text6.Text
Set rcdset = Adodc1.Recordset
If rcdset.RecordCount = 0 Then
MsgBox "無該記錄或輸入數(shù)據(jù)有誤。請查正。"
Exit Sub
Else
Text7.Text = rcdset!姓名
Combo2.Text = rcdset!單位
Text8.Text = "" & rcdset!備注
Combo2.Enabled = True
Text6.Enabled = False
Text7.Enabled = True
Text8.Enabled = True
Command4.Enabled = True
End If
End If
End Sub
'執(zhí)行更新學(xué)生記錄操作
Private Sub Command4_Click()
If Text7.Text = "" Or Combo2.Text = "" Then
MsgBox "請完整填寫必要字段,簡介可不填。"
Exit Sub
Else
rcdset!姓名 = Text7.Text
rcdset!備注 = Text8.Text
rcdset!單位 = Combo2.Text
rcdset.update
Adodc1.Refresh
MsgBox "更新記錄成功。"
Command4.Enabled = False
Text6.Enabled = True
Text7.Enabled = False
Text8.Enabled = False
Combo2.Enabled = False
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Image2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.BorderStyle = 1
End Sub
Private Sub Image2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.BorderStyle = 0
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.BorderStyle = 1
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.BorderStyle = 0
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -