📄 form3.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form3
Caption = "药品入库"
ClientHeight = 5775
ClientLeft = 3945
ClientTop = 2205
ClientWidth = 7710
LinkTopic = "Form3"
Picture = "Form3.frx":0000
ScaleHeight = 5775
ScaleWidth = 7710
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 5760
TabIndex = 18
Top = 3960
Width = 1695
_ExtentX = 2990
_ExtentY = 661
_Version = 393216
Format = 21168129
CurrentDate = 39259
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1200
TabIndex = 17
Top = 3960
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
Format = 21168129
CurrentDate = 39259
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4560
TabIndex = 16
Top = 4920
Width = 1095
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1200
TabIndex = 14
Top = 600
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 12
Top = 4920
Width = 1215
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "Form3.frx":20FE
Left = 5760
List = "Form3.frx":2114
TabIndex = 9
Top = 600
Width = 1695
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 5760
TabIndex = 8
Top = 2880
Width = 1335
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1200
TabIndex = 7
Top = 2880
Width = 1335
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 5760
TabIndex = 6
Top = 1680
Width = 1695
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1200
TabIndex = 5
Top = 1680
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "元"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7200
TabIndex = 15
Top = 3000
Width = 495
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入库编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 120
TabIndex = 13
Top = 720
Width = 1200
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "生产日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 11
Top = 4080
Width = 1185
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "过期日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 4680
TabIndex = 10
Top = 4080
Width = 1200
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入库价:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 4920
TabIndex = 4
Top = 3000
Width = 960
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "药品名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 3
Top = 1800
Width = 1200
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "库存单位:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 4680
TabIndex = 2
Top = 1800
Width = 1200
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入库量:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 1
Top = 3000
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "药品代码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 0
Left = 4680
TabIndex = 0
Top = 720
Width = 1200
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_click()
Select Case Combo1.ListIndex
Case 0
Text3.Text = "板蓝跟颗粒"
Text4.Text = "袋"
Case 1
Text3.Text = "诺氟沙星胶囊"
Text4.Text = "盒"
Case 2
Text3.Text = "阿莫西林胶囊"
Text4.Text = "盒"
Case 3
Text3.Text = "硫酸庆大霉素注射液"
Text4.Text = "盒"
Case 4
Text3.Text = "维C银翘片"
Text4.Text = "袋"
Case 5
Text3.Text = "维生素B2片"
Text4.Text = "盒"
End Select
End Sub
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
If Text1.Text = "" Or (Not IsNumeric(Text1.Text)) Then
MsgBox "请输入进库编号!", vbOKOnly + vbExclamation, "警告!"
Text1.SetFocus
Else
If Combo1.Text = "" Then
MsgBox "请输入药品代码!", vbOKOnly + vbExclamation, "警告!"
Combo1.SetFocus
Else
If Text5.Text = "" Or (Not IsNumeric(Text5.Text)) Then
MsgBox "请输入入库数量!", vbOKOnly + vbExclamation, "警告!"
Text5.SetFocus
Else
If Text6.Text = "" Then
MsgBox "请输入入库价格!", vbOKOnly + vbExclamation, "警告!"
Text6.SetFocus
Else
sql = "select * from 药品库存表"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Combo1.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = DTPicker1.Value
rs.Fields(6) = Text6.Text
rs.Fields(7) = DTPicker2.Value
rs.Update
MsgBox "药品入库操作完成,", vbOKOnly + vbExclamation, "恭喜!"
Text1.Text = ""
Combo1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Text1_LostFocus()
Dim rs As New ADODB.Recordset
Dim sql As String
If Text1.Text = "" Or (Not IsNumeric(Text1.Text)) Then
MsgBox "请输入进库编号!", vbOKOnly + vbExclamation, "警告!"
Text1.SetFocus
Else
sql = "select * from 药品库存表"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs.Fields(0) Then
MsgBox "请重新选择一个进库编号,", vbOKOnly + vbExclamation, "警告!"
Text1.SetFocus
End If
rs.MoveNext
Loop
rs.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -