📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
BackColor = &H80000010&
BorderStyle = 1 'Fixed Single
Caption = "拟定\修改销售价格"
ClientHeight = 3045
ClientLeft = 45
ClientTop = 450
ClientWidth = 5760
LinkTopic = "Form4"
MaxButton = 0 'False
ScaleHeight = 3045
ScaleWidth = 5760
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
BackColor = &H80000010&
Caption = "药品信息"
Height = 1335
Left = 240
TabIndex = 7
Top = 120
Width = 5415
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "Label11"
ForeColor = &H0000FFFF&
Height = 255
Left = 3600
TabIndex = 15
Top = 840
Width = 855
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "Label10"
ForeColor = &H0000FFFF&
Height = 255
Left = 960
TabIndex = 14
Top = 840
Width = 1095
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "保质期"
ForeColor = &H0000FFFF&
Height = 255
Left = 2640
TabIndex = 13
Top = 840
Width = 735
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "出厂日期"
ForeColor = &H0000FFFF&
Height = 255
Left = 120
TabIndex = 12
Top = 840
Width = 855
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "Label7"
ForeColor = &H0000FFFF&
Height = 255
Left = 3600
TabIndex = 11
Top = 360
Width = 1455
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "生产厂家"
ForeColor = &H0000FFFF&
Height = 255
Left = 2640
TabIndex = 10
Top = 360
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "药品名称"
ForeColor = &H0000FFFF&
Height = 255
Left = 120
TabIndex = 9
Top = 360
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 375
Left = 960
TabIndex = 8
Top = 360
Width = 1455
End
End
Begin VB.CommandButton Command2
BackColor = &H0080C0FF&
Caption = "确定"
Height = 375
Left = 3120
Style = 1 'Graphical
TabIndex = 5
Top = 2520
Width = 855
End
Begin VB.CommandButton Command1
BackColor = &H0080C0FF&
Caption = "取消"
Height = 375
Left = 3960
Style = 1 'Graphical
TabIndex = 4
Top = 2520
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Left = 2400
TabIndex = 3
Top = 2040
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2400
TabIndex = 1
Top = 1560
Width = 1455
End
Begin VB.Image Image2
Height = 240
Left = 600
Picture = "Form4.frx":0000
Stretch = -1 'True
Top = 2040
Width = 240
End
Begin VB.Image Image1
Height = 225
Left = 600
Picture = "Form4.frx":030A
Stretch = -1 'True
Top = 1560
Width = 240
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "Label5"
ForeColor = &H00FF0000&
Height = 615
Left = 4080
TabIndex = 6
Top = 1560
Width = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "设 定 定 价"
ForeColor = &H00C000C0&
Height = 255
Left = 960
TabIndex = 2
Top = 2040
Width = 1095
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "设定销售单位"
ForeColor = &H00C000C0&
Height = 375
Left = 960
TabIndex = 0
Top = 1560
Width = 1215
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim xpk%
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
If Combo1.Text = "" Then
MsgBox "请输入或选择销售单位!", vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "请为该药品设置销售价格!", vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If Not IsNumeric(Text1) Then
MsgBox "非法输入请重新输入!", vbOKOnly + vbInformation, "提示"
Text1 = ""
Text1.SetFocus
Exit Sub
End If
Call adoopen
sql = "select * from xiaosdingjia"
Call rs(sql)
If adors.EOF Then
xpk = 1
Call adoclose
Else
Call adoclose
Call adoopen
sql = "select max(xpk) as xpk from xiaosdingjia"
Call rs(sql)
xpk = Val(adors.Fields("xpk")) + 1
Call adoclose
End If
Call adoopen
sql = "select * from xiaosdingjia where pk='" & change(7) & "'"
Call rs(sql)
If Not adors.EOF Then
adors.Fields("ddanwei") = Combo1.Text
adors.Fields("dingjia") = Text1
adors.Update
Call adoclose
MsgBox "修改成功!", vbOKOnly + vbInformation, "提示"
Else
Call adoclose
Call adoopen
sql = "insert into xiaosdingjia values('" & change(7) & "','" & Combo1.Text & "','" & Text1 & "','" & Val(xpk) & "')"
Call rs(sql)
Call adoclose
MsgBox "设置成功!", vbOKOnly + vbInformation, "提示"
End If
Form1.Combo3.Clear
sql = "select yname from yaopinjbxx,xiaosdingjia,namezidian where yaopinjbxx.pk=xiaosdingjia.pk and yaopinjbxx.yno=namezidian.yno"
Call comadd(sql, "yname", Form1.Combo3)
Unload Me
End Sub
Private Sub Form_Load()
Move MDIForm1.Left + (MDIForm1.Width - Me.Width) / 2, MDIForm1.Top + 3000
Label2.Caption = change(0)
Label7.Caption = change(2)
Label10.Caption = change(3)
Label11.Caption = change(4)
sql = "select dname from danweizidian"
Call comadd(sql, "dname", Combo1)
Call adoopen
sql = "select * from xiaosdingjia where pk='" & change(7) & "'"
Call rs(sql)
If Not adors.EOF Then
Label5.Caption = "已设置定价,可以在此处修改"
Else
Label5.Caption = "该药品还未设置定价!"
End If
Call adoclose
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -