📄 main_ypwh_add.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Main_Ypwh_Add
BackColor = &H00E3D9E6&
ClientHeight = 4815
ClientLeft = 60
ClientTop = 60
ClientWidth = 7905
ControlBox = 0 'False
ForeColor = &H00C0C0C0&
LinkTopic = "Form1"
ScaleHeight = 4815
ScaleWidth = 7905
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -975
Top = 2805
Visible = 0 'False
Width = 1410
_ExtentX = 2487
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MZJJSFXT"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MZJJSFXT"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 药品信息表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton CmdCancel
Caption = "(&C)取消"
Height = 375
Left = 4020
TabIndex = 7
Top = 4230
Width = 1830
End
Begin VB.CommandButton CmdSave
Caption = "(&S)保存"
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 = 3750
TabIndex = 30
Top = 1035
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
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
Locked = -1 'True
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_Add"
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 ("盒")
Cbozxdw.AddItem ("瓶")
Cbozxdw.AddItem ("袋")
Cbobzdw.AddItem ("盒")
Cbobzdw.AddItem ("瓶")
Cbobzdw.AddItem ("袋")
Cbozflx.AddItem ("自费")
Cbozflx.AddItem ("公费")
Cbolb.AddItem ("西药")
Cbolb.AddItem ("中药")
Cbodmbz.AddItem ("毒麻")
Cbodmbz.AddItem ("其他")
Adodc1.RecordSource = "select * from 药品信息表 order by 药品编码"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Text1(0).Text = "0000001"
Else
Adodc1.Recordset.MoveLast
Text1(0).Text = Format(Adodc1.Recordset.Fields("药品编码") + 1, "0000000")
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
GotFocusBC Text1(Index)
Text1(8).Text = Format(Val(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 Cbobzdw_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(8).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 药品信息表", cnn, adOpenKeyset, adLockOptimistic
rs.AddNew
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
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 + -