?? frm_inf_del.frm
字號:
VERSION 5.00
Begin VB.Form frm_inf_del
Caption = "Form1"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 450
ClientWidth = 7380
LinkTopic = "Form1"
ScaleHeight = 3585
ScaleWidth = 7380
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Fault
Caption = "取消"
Height = 375
Left = 4560
TabIndex = 19
Top = 3120
Width = 1575
End
Begin VB.CommandButton Cmd_del
Caption = "刪除"
Height = 375
Left = 1320
TabIndex = 18
Top = 3120
Width = 1455
End
Begin VB.Frame Frame1
Height = 1815
Left = 120
TabIndex = 1
Top = 1080
Width = 7095
Begin VB.TextBox Drug_name
Height = 285
Left = 1560
TabIndex = 9
Top = 240
Width = 1695
End
Begin VB.TextBox Import_price
Height = 285
Left = 1560
TabIndex = 8
Top = 960
Width = 1695
End
Begin VB.TextBox Drug_type
Height = 285
Left = 1560
TabIndex = 7
Top = 600
Width = 1695
End
Begin VB.TextBox Export_price
Height = 285
Left = 1560
TabIndex = 6
Top = 1320
Width = 1695
End
Begin VB.TextBox Drug_num
Height = 285
Left = 4800
TabIndex = 5
Top = 240
Width = 1695
End
Begin VB.TextBox Import_time
Height = 285
Left = 4800
TabIndex = 4
Top = 600
Width = 1695
End
Begin VB.TextBox Prodcom
Height = 285
Left = 4800
TabIndex = 3
Top = 960
Width = 1695
End
Begin VB.TextBox Prodplace
Height = 285
Left = 4800
TabIndex = 2
Top = 1320
Width = 1695
End
Begin VB.Label Label1
Caption = "庫存藥品名稱"
Height = 255
Left = 240
TabIndex = 17
Top = 240
Width = 1215
End
Begin VB.Label Label2
Caption = "藥品入庫價格"
Height = 255
Left = 240
TabIndex = 16
Top = 960
Width = 1215
End
Begin VB.Label Label3
Caption = "庫存藥品類型"
Height = 255
Left = 240
TabIndex = 15
Top = 600
Width = 1215
End
Begin VB.Label Label4
Caption = "藥品出庫價格"
Height = 255
Left = 240
TabIndex = 14
Top = 1320
Width = 1215
End
Begin VB.Label Label5
Caption = "藥品庫存量"
Height = 255
Left = 3600
TabIndex = 13
Top = 240
Width = 1215
End
Begin VB.Label Label6
Caption = "入庫時間"
Height = 375
Left = 3600
TabIndex = 12
Top = 600
Width = 1215
End
Begin VB.Label Label7
Caption = "生產廠商"
Height = 255
Left = 3600
TabIndex = 11
Top = 960
Width = 1095
End
Begin VB.Label Label8
Caption = "產地"
Height = 255
Left = 3600
TabIndex = 10
Top = 1320
Width = 1095
End
End
Begin VB.Frame Frame2
Height = 855
Left = 120
TabIndex = 0
Top = 120
Width = 7095
Begin VB.CommandButton Cmd_del_que
Caption = "查詢"
Height = 255
Left = 4200
TabIndex = 22
Top = 360
Width = 1335
End
Begin VB.TextBox del_que
Height = 285
Left = 2160
TabIndex = 20
Top = 360
Width = 1695
End
Begin VB.Label Label9
Caption = "庫存藥品名稱"
Height = 255
Left = 840
TabIndex = 21
Top = 360
Width = 1215
End
End
End
Attribute VB_Name = "frm_inf_del"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_del_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查詢內容不能為空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "沒有所查詢的藥品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
objRS.Close
strSQL = "Delete from Drug_info Where Drug_name='" + QueName + "'"
objConn.Execute (strSQL)
CloseDB
MsgBox "記錄已刪除", vbOKOnly
End If
End If
End Sub
Private Sub Cmd_del_que_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查詢內容不能為空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "沒有所查詢的藥品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
Drug_name.Text = objRS.Fields(1).Value
Drug_type.Text = objRS.Fields(2).Value
Import_price.Text = Str(objRS.Fields(3).Value)
Export_price.Text = Str(objRS.Fields(4).Value)
Import_time.Text = Str(objRS.Fields(5).Value)
Drug_num.Text = Str(objRS.Fields(6).Value)
Prodcom.Text = objRS.Fields(7).Value
Prodplace.Text = objRS.Fields(8).Value
End If
End If
objRS.Close
CloseDB
End Sub
Private Sub Fault_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -