?? 刪除舊書(shū).frm
字號(hào):
VERSION 5.00
Begin VB.Form form6
Caption = "Form2"
ClientHeight = 4545
ClientLeft = 60
ClientTop = 390
ClientWidth = 5880
LinkTopic = "Form2"
ScaleHeight = 4545
ScaleWidth = 5880
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 495
Left = 1800
TabIndex = 6
Top = 1800
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3360
TabIndex = 3
Top = 3480
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 1560
TabIndex = 2
Top = 3480
Width = 1095
End
Begin VB.TextBox Text1
Height = 615
Left = 1680
TabIndex = 1
Top = 840
Width = 2895
End
Begin VB.Label Label3
Caption = "數(shù)量"
Height = 495
Left = 480
TabIndex = 5
Top = 1920
Width = 1095
End
Begin VB.Label Label2
Caption = "刪除書(shū)庫(kù)的某些圖書(shū)"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 495
Left = 360
TabIndex = 4
Top = 120
Width = 4455
End
Begin VB.Label Label1
Caption = "輸入書(shū)號(hào)"
Height = 615
Left = 480
TabIndex = 0
Top = 840
Width = 1575
End
End
Attribute VB_Name = "form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim note As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql As String
Dim answer As Integer
sql = "select * from 書(shū)庫(kù)表 where 書(shū)號(hào)='" & Trim(Text1.Text) & "'"
note.Open sql, cnn, 3, 2
If note.BOF And note.EOF Then
MsgBox ("無(wú)此記錄!")
note.Close
Text1.Text = ""
Else
answer = MsgBox("你確定要?jiǎng)h除此類圖書(shū)嗎?", vbYesNo, "提示")
If answer = vbYes Then
If note.Fields("數(shù)量").Value = 0 Then
note.Delete
note.Close
Text1.Text = ""
ElseIf note.Fields("數(shù)量").Value = Val(Text2.Text) Then
note.Delete
note.Close
Text1.Text = ""
MsgBox "此圖書(shū)已全部刪除!"
ElseIf note.Fields("數(shù)量").Value > Val(Text2.Text) Then
note.Fields("數(shù)量").Value = note.Fields("數(shù)量").Value - Val(Text2.Text)
note.Update
note.Close
Text1.Text = ""
MsgBox "此圖書(shū)已刪掉" + Text2.Text
Else
MsgBox "此類圖書(shū)沒(méi)有這么多,請(qǐng)重新輸入數(shù)量!"
note.Close
Text1.Text = ""
Text2.Text = ""
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -