?? 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 "遠程數據服務器連接失?。?quot;
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 + -