📄 madecode.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmcode
BorderStyle = 3 'Fixed Dialog
Caption = "编制常用代码"
ClientHeight = 3105
ClientLeft = 45
ClientTop = 330
ClientWidth = 5400
Icon = "madecode.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "madecode.frx":030A
ScaleHeight = 3105
ScaleWidth = 5400
ShowInTaskbar = 0 'False
Begin VB.PictureBox Picture3
Height = 615
Left = 120
Picture = "madecode.frx":59F9
ScaleHeight = 555
ScaleWidth = 5115
TabIndex = 2
Top = 120
Width = 5175
Begin VB.CommandButton Command1
Caption = "显示代码列表&(D)"
Height = 300
Left = 3120
TabIndex = 17
Top = 120
Width = 1600
End
Begin VB.ComboBox Combo1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 300
ItemData = "madecode.frx":B0E8
Left = 1320
List = "madecode.frx":B0FE
TabIndex = 4
Top = 120
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "选择代码库"
Height = 180
Left = 360
TabIndex = 3
Top = 180
Width = 900
End
End
Begin VB.PictureBox Picture2
Height = 615
Left = 120
Picture = "madecode.frx":B142
ScaleHeight = 555
ScaleWidth = 5115
TabIndex = 1
Top = 2400
Width = 5175
Begin VB.CommandButton cmdadd
Caption = "添加&(A)"
Height = 300
Left = 240
TabIndex = 8
Top = 120
Width = 1000
End
Begin VB.CommandButton cmddelete
Caption = "删除&(D)"
Height = 300
Left = 1470
TabIndex = 7
Top = 120
Width = 1000
End
Begin VB.CommandButton cmdupdate
Caption = "更新&(C)"
Height = 300
Left = 2680
TabIndex = 6
Top = 120
Width = 1000
End
Begin VB.CommandButton cmdclose
Caption = "关闭&(C)"
Height = 300
Left = 3900
TabIndex = 5
Top = 120
Width = 1000
End
End
Begin VB.PictureBox Picture1
Height = 1455
Left = 120
Picture = "madecode.frx":10831
ScaleHeight = 1395
ScaleWidth = 5115
TabIndex = 0
Top = 840
Width = 5175
Begin VB.TextBox Text4
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 3360
TabIndex = 14
Top = 480
Width = 1335
End
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 840
TabIndex = 13
Top = 480
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 220
Top = 960
Width = 4690
_ExtentX = 8255
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = 16777215
ForeColor = 16711680
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = ""
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.TextBox Text2
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 3360
TabIndex = 12
Top = 120
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 840
TabIndex = 11
Top = 120
Width = 1815
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "规格"
Height = 180
Left = 360
TabIndex = 16
Top = 510
Width = 360
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "编号"
Height = 180
Left = 2880
TabIndex = 15
Top = 510
Width = 360
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "代码"
Height = 180
Left = 2880
TabIndex = 10
Top = 150
Width = 360
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "名称"
Height = 180
Left = 360
TabIndex = 9
Top = 150
Width = 360
End
End
End
Attribute VB_Name = "frmcode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public title As String
Public Sub Errmsg()
MsgBox " 你可能执行了非法操作! "
End Sub
Private Sub cmdAdd_Click()
On Error GoTo err1
Adodc1.Recordset.AddNew
Exit Sub
err1:
Call Errmsg
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
On Error GoTo err2
With Adodc1.Recordset
If .AbsolutePosition <> adPosUnknown Then
.Delete
If Not .EOF Then .MoveNext
Else
MsgBox "数据库中没有可删除的记录!"
End If
End With
Exit Sub
err2:
Call Errmsg
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo err3
If Combo1.Text = "药品代码" Then
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Then
MsgBox "数据填写不完整,不能更新!"
Else
Adodc1.Recordset.Update
End If
Else
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "数据填写不完整,不能更新!"
Else
Adodc1.Recordset.Update
End If
End If
Exit Sub
err3:
Call Errmsg
End Sub
Private Sub Combo1_Click()
On Error GoTo err4
If Combo1.Text = "" Then
Command1.Enabled = False
Else
title = Combo1.Text
End If
Select Case Combo1.Text
Case "药品代码"
Adodc1.RecordSource = "select * from ypcode order by 编号"
Adodc1.Refresh
Label4.Visible = True
Label5.Visible = True
Text3.Visible = True
Text4.Visible = True
Text1.DataField = "药品名称"
Text2.DataField = "代码"
Text3.DataField = "规格"
Text4.DataField = "编号"
Case "医生代码"
Adodc1.RecordSource = "select * from dotcode order by ID"
Adodc1.Refresh
Text1.DataField = "姓名"
Text2.DataField = "代码"
Label4.Visible = False
Label5.Visible = True
Label5.Caption = "科室"
Text3.Visible = True
Text3.DataField = "科室"
Text4.Visible = False
Case "科室代码"
Adodc1.RecordSource = "select * from kscode order by ID"
Adodc1.Refresh
Text1.DataField = "科室名称"
Text2.DataField = "代码"
Label4.Visible = False
Label5.Visible = False
Text3.Visible = False
Text4.Visible = False
Adodc1.Caption = "这是第" & CStr(Adodc1.Recordset.AbsolutePosition) & "条记录,共" & CStr(Adodc1.Recordset.RecordCount) & "条记录"
Case "其它代码"
Adodc1.RecordSource = "select * from othercode order by ID"
Adodc1.Refresh
Text1.DataField = "名称"
Text2.DataField = "代码"
Label4.Visible = False
Label5.Visible = False
Text3.Visible = False
Text4.Visible = False
Case "草药代码"
Adodc1.RecordSource = "select * from cycode order by ID"
Adodc1.Refresh
Label4.Visible = True
Label5.Visible = True
Text3.Visible = True
Text4.Visible = True
Text1.DataField = "名称"
Text2.DataField = "代码"
Text3.DataField = "规格"
Text4.DataField = "编号"
Case "器械材料代码"
Adodc1.RecordSource = "select * from qxcode order by ID"
Adodc1.Refresh
Label4.Visible = True
Label5.Visible = True
Text3.Visible = True
Text4.Visible = True
Text1.DataField = "名称"
Text2.DataField = "代码"
Text3.DataField = "规格"
Text4.DataField = "编号"
End Select
Exit Sub
err4:
Call Errmsg
End Sub
Private Sub Command1_Click()
Command1.Enabled = False
frmtable.Show
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活动窗口:" & frmcode.Caption
End Sub
Private Sub Form_Load()
On Error GoTo err5
frmcode.Top = (frmmain.Height - frmcode.Height) / 2 - 500
frmcode.Left = (frmmain.Width - frmcode.Width) / 2
Adodc1.ConnectionString = frmlogin.conn
Adodc1.RecordSource = "select * from ypcode order by 编号"
Adodc1.Refresh
Set Text1.DataSource = Adodc1
Set Text2.DataSource = Adodc1
Set Text3.DataSource = Adodc1
Set Text4.DataSource = Adodc1
Combo1.Text = "药品代码"
title = "药品代码"
Exit Sub
err5:
MsgBox "远程数据服务器连接失败!"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -