📄 main_ypwh_update.frm
字号:
VERSION 5.00
Begin VB.Form Main_Ypwh_Update
BackColor = &H00E3D9E6&
ClientHeight = 4815
ClientLeft = 60
ClientTop = 60
ClientWidth = 7905
ControlBox = 0 'False
ForeColor = &H00C0C0C0&
LinkTopic = "Form1"
ScaleHeight = 4815
ScaleWidth = 7905
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton CmdCancel
Caption = "(&C)取消"
Height = 375
Left = 4020
TabIndex = 7
Top = 4230
Width = 1830
End
Begin VB.CommandButton CmdSave
Caption = "(&M)修改"
Height = 375
Left = 2205
TabIndex = 8
Top = 4230
Width = 1830
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "修改门诊库存药品"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 3750
Left = 285
TabIndex = 0
Top = 255
Width = 7350
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 285
Index = 8
Left = 3735
Locked = -1 'True
TabIndex = 30
Top = 1020
Width = 3345
End
Begin VB.ComboBox Cbodmbz
Height = 300
Left = 3735
TabIndex = 29
Top = 2775
Width = 3345
End
Begin VB.ComboBox Cbobzdw
Height = 300
Left = 3750
TabIndex = 28
Top = 585
Width = 3345
End
Begin VB.ComboBox Cbozxdw
Height = 300
Left = 1050
TabIndex = 27
Top = 2760
Width = 1650
End
Begin VB.ComboBox Cbojx
Height = 300
Left = 1035
TabIndex = 26
Top = 1875
Width = 1650
End
Begin VB.ComboBox Cbolb
Height = 300
Left = 3750
TabIndex = 25
Top = 2325
Width = 3345
End
Begin VB.ComboBox Cbozflx
Height = 300
Left = 3750
TabIndex = 24
Top = 1890
Width = 3345
End
Begin VB.TextBox Text1
Height = 285
Index = 13
Left = 3750
TabIndex = 18
Top = 3195
Width = 3345
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 285
Index = 9
Left = 3750
Locked = -1 'True
TabIndex = 17
Top = 1455
Width = 3345
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 285
Index = 6
Left = 1035
TabIndex = 16
Top = 3195
Width = 1650
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 285
Index = 4
Left = 1035
TabIndex = 12
Top = 2325
Width = 1650
End
Begin VB.TextBox Text1
Height = 285
Index = 2
Left = 1035
TabIndex = 9
Top = 1455
Width = 1650
End
Begin VB.TextBox Text1
Height = 285
Index = 1
Left = 1020
TabIndex = 2
Top = 1020
Width = 1650
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 285
Index = 0
Left = 1035
TabIndex = 1
Top = 615
Width = 1650
End
Begin VB.Label Label14
BackStyle = 0 'Transparent
Caption = "库存数量"
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 23
Top = 1500
Width = 765
End
Begin VB.Label Label13
BackStyle = 0 'Transparent
Caption = "生产企业"
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 22
Top = 3225
Width = 765
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "自费类型"
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 21
Top = 1920
Width = 765
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "类别 "
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 20
Top = 2355
Width = 870
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "毒麻标志"
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 19
Top = 2805
Width = 765
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "规格"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 15
Top = 2355
Width = 765
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "零售价"
ForeColor = &H00FF0000&
Height = 165
Left = 2880
TabIndex = 14
Top = 1095
Width = 765
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "剂型 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 13
Top = 1920
Width = 870
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "包装单位"
ForeColor = &H00FF0000&
Height = 330
Left = 2880
TabIndex = 11
Top = 690
Width = 765
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "拼音码"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 10
Top = 1500
Width = 765
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "包装量 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 6
Top = 3225
Width = 765
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "最小单位"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 5
Top = 2805
Width = 765
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "药品编码 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 4
Top = 690
Width = 870
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "品名"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 3
Top = 1095
Width = 765
End
End
End
Attribute VB_Name = "Main_Ypwh_Update"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
Text1(1).SetFocus
End Sub
Private Sub Form_Load()
Cbojx.AddItem ("片剂")
Cbojx.AddItem ("胶囊")
Cbojx.AddItem ("水剂")
Cbojx.AddItem ("针剂")
Cbozxdw.AddItem ("盒")
Cbozxdw.AddItem ("瓶")
Cbozxdw.AddItem ("袋")
Cbobzdw.AddItem ("盒")
Cbobzdw.AddItem ("瓶")
Cbobzdw.AddItem ("袋")
Cbozflx.AddItem ("自费")
Cbozflx.AddItem ("公费")
Cbolb.AddItem ("西药")
Cbolb.AddItem ("中药")
Cbodmbz.AddItem ("毒麻")
Cbodmbz.AddItem ("其他")
For i = 0 To 2
'对应列
Main_Ypwh.MSHFlexGrid1.Col = i
Text1(i).Text = Main_Ypwh.MSHFlexGrid1.Text
Next i
Main_Ypwh.MSHFlexGrid1.Col = 3
Cbojx.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 4
Text1(4).Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 5
Cbozxdw.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 6
Text1(6).Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 7
Cbobzdw.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 8
Text1(8).Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 9
Text1(9).Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 10
Cbozflx.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 11
Cbolb.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 12
Cbodmbz.Text = Main_Ypwh.MSHFlexGrid1.Text
Main_Ypwh.MSHFlexGrid1.Col = 13
Text1(13).Text = Main_Ypwh.MSHFlexGrid1.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
GotFocusBC Text1(Index)
Text1(8).Text = Format(Text1(8).Text, "0.00")
End Sub
Private Sub Text1_LostFocus(Index As Integer)
LostFocusBC Text1(Index)
End Sub
Private Sub Cbolb_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Cbodmbz.SetFocus
End Sub
Private Sub Cbozflx_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Cbolb.SetFocus
End Sub
Private Sub Cbozxdw_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(6).SetFocus
End Sub
Private Sub Cbodmbz_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(13).SetFocus
End Sub
Private Sub Cbojx_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(4).SetFocus
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Index < 2 And KeyCode = vbKeyReturn Then Text1(Index + 1).SetFocus
If Index = 2 And KeyCode = vbKeyReturn Then Cbojx.SetFocus
If Index = 4 And KeyCode = vbKeyReturn Then Cbozxdw.SetFocus
If Index = 6 And KeyCode = vbKeyReturn Then Cbobzdw.SetFocus
If Index = 8 And KeyCode = vbKeyReturn Then Text1(9).SetFocus
If Index = 9 And KeyCode = vbKeyReturn Then Cbozflx.SetFocus
If Index = 13 And KeyCode = vbKeyReturn Then CmdSave.SetFocus
End Sub
Private Sub CmdSave_Click()
Dim rs As New ADODB.Recordset
rs.Open "select * from 药品信息表 where 药品编码='" + Text1(0).Text + "'", cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
For i = 0 To 2
rs.Fields(i) = Trim(Text1(i).Text)
Next i
rs.Fields("剂型") = Trim(Cbojx.Text)
rs.Fields("规格") = Trim(Text1(4).Text)
rs.Fields("最小单位") = Trim(Cbozxdw.Text)
rs.Fields("包装量") = Val(Text1(6).Text)
rs.Fields("包装单位") = Trim(Cbobzdw.Text)
rs.Fields("零售价") = Text1(8).Text
rs.Fields("库存数量") = Val(Text1(9).Text)
rs.Fields("自费类型") = Trim(Cbozflx.Text)
rs.Fields("类别") = Trim(Cbolb.Text)
rs.Fields("毒麻标志") = Trim(Cbodmbz.Text)
rs.Fields("生产企业") = Trim(Text1(13).Text)
rs.Update
Else
MsgBox "库存无此药品!"
End If
rs.Close
Main_Ypwh.Adodc1.Refresh
EnaT Main_Ypwh
Unload Me
End Sub
Private Sub CmdCancel_Click()
EnaT Main_Ypwh
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -