📄 frm_ex_del.frm
字号:
VERSION 5.00
Begin VB.Form frm_ex_del
Caption = "添加出库信息"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 450
ClientWidth = 5130
LinkTopic = "Form1"
ScaleHeight = 3435
ScaleWidth = 5130
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame2
Height = 855
Left = 240
TabIndex = 17
Top = 120
Width = 4575
Begin VB.CommandButton Cmd_del_que
Caption = "查询"
Height = 255
Left = 3000
TabIndex = 20
Top = 360
Width = 1095
End
Begin VB.TextBox del_que
Height = 285
Left = 1680
TabIndex = 19
Top = 360
Width = 1215
End
Begin VB.Label Label8
Caption = "输入出库药品名称"
Height = 375
Left = 120
TabIndex = 18
Top = 360
Width = 1815
End
End
Begin VB.CommandButton Fault
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 16
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmd_ex_del
Caption = "删除"
Height = 375
Left = 840
TabIndex = 15
Top = 2880
Width = 1095
End
Begin VB.Frame Frame1
Height = 1815
Left = 240
TabIndex = 0
Top = 960
Width = 4575
Begin VB.TextBox Export_time
Height = 285
Left = 3600
TabIndex = 14
Top = 960
Width = 855
End
Begin VB.TextBox Patient_num
Height = 285
Left = 3600
TabIndex = 12
Top = 600
Width = 855
End
Begin VB.TextBox Patient_name
Height = 285
Left = 3600
TabIndex = 10
Top = 240
Width = 855
End
Begin VB.TextBox Export_price
Height = 285
Left = 1320
TabIndex = 8
Top = 1320
Width = 855
End
Begin VB.TextBox Export_type
Height = 285
Left = 1320
TabIndex = 6
Top = 600
Width = 855
End
Begin VB.TextBox Export_num
Height = 285
Left = 1320
TabIndex = 4
Top = 960
Width = 855
End
Begin VB.TextBox Export_name
Height = 285
Left = 1320
TabIndex = 2
Top = 240
Width = 855
End
Begin VB.Label Label7
Caption = "出库时间"
Height = 255
Left = 2400
TabIndex = 13
Top = 960
Width = 1095
End
Begin VB.Label Label6
Caption = "购药病人编号"
Height = 255
Left = 2400
TabIndex = 11
Top = 600
Width = 1095
End
Begin VB.Label Label5
Caption = "购药病人姓名"
Height = 255
Left = 2400
TabIndex = 9
Top = 240
Width = 1095
End
Begin VB.Label Label4
Caption = "药品出库价格"
Height = 255
Left = 120
TabIndex = 7
Top = 1320
Width = 1095
End
Begin VB.Label Label3
Caption = "出库药品类型"
Height = 255
Left = 120
TabIndex = 5
Top = 600
Width = 1095
End
Begin VB.Label Label2
Caption = "药品出库数量"
Height = 255
Left = 120
TabIndex = 3
Top = 960
Width = 1095
End
Begin VB.Label Label1
Caption = "出库药品名称"
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 1095
End
End
End
Attribute VB_Name = "frm_ex_del"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
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_export where export_name='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockOptimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
Export_name.Text = objRS.Fields(1).Value
Export_type.Text = objRS.Fields(2).Value
Export_price.Text = Str(objRS.Fields(4).Value)
Export_num.Text = Str(objRS.Fields(3).Value)
Patient_name.Text = objRS.Fields(5).Value
Patient_num.Text = objRS.Fields(6).Value
Export_time.Text = Str(objRS.Fields(7).Value)
objRS.Close
CloseDB
End If
End If
End Sub
Private Sub Cmd_ex_del_Click()
Dim strSQL As String
Dim QueName As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询名称不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_export Where Export_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_export where Export_name ='" + QueName + "'"
objConn.Execute (strSQL)
CloseDB
MsgBox "记录已删除", vbOKOnly
End If
End If
End Sub
Private Sub Fault_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -