📄 frm_zygl.frm
字号:
Caption = "主要诊断"
Height = 375
Left = 240
TabIndex = 15
Top = 1440
Width = 975
End
Begin VB.Label Label6
Caption = "电话"
Height = 255
Left = 5280
TabIndex = 13
Top = 960
Width = 735
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "联系地址"
Height = 255
Left = 1920
TabIndex = 11
Top = 960
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "出生日期"
Height = 255
Left = 5280
TabIndex = 8
Top = 480
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性别"
Height = 255
Left = 3960
TabIndex = 6
Top = 480
Width = 495
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "姓名"
Height = 255
Left = 2280
TabIndex = 4
Top = 480
Width = 495
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "住院号"
Height = 255
Left = 240
TabIndex = 2
Top = 480
Width = 735
End
End
Begin VB.CheckBox Check2
Caption = "Check2"
Height = 255
Left = 2040
TabIndex = 34
Top = 4440
Width = 1095
End
Begin VB.TextBox Text10
Height = 270
Left = 1920
TabIndex = 35
Text = "Text10"
Top = 4560
Width = 1095
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 4080
Top = 4200
Width = 2055
_ExtentX = 3625
_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=ZYGL"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ZYGL"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_ksb"
Caption = "Adodc2"
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
End
Attribute VB_Name = "frm_zygl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()
'Adodc1.RecordSource = "select * from Table_zyxx order by 住院号"
'Adodc1.Refresh
'If Adodc1.Recordset.RecordCount > 0 Then
'Adodc1.Recordset.MoveLast
'Text1.Text = Val(Adodc1.Recordset.Fields("住院号")) + 1
'Else
'Text1.Text = 1
'End If
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text4.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Text1.SetFocus
Cmd_save.Enabled = True
Cmd_add.Enabled = False
End Sub
Private Sub Cmd_del_Click()
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您确认要删除信息吗?", 17, "医院住院管理系统")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
Else
MsgBox "当前数据库中已经没有可删除的记录", 64, "医院住院管理系统"
End If
End Sub
Private Sub Cmd_edit_Click()
If Text1.Text = "" Then
MsgBox "请输入住院号进行查询所要修改病人的住院信息", 64, "医院住院管理系统"
Else
If Not IsNumeric(Text1.Text) Then
MsgBox "输入必须为数字"
Text1.Text = ""
Text1.SetFocus
Else
Text1.Locked = False
Adodc1.RecordSource = "select * from Table_zyxx where 住院号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("住院号")
Text2.Text = Adodc1.Recordset.Fields("性别")
Combo1.Text = Adodc1.Recordset.Fields("性别")
Combo2.Text = Adodc1.Recordset.Fields("付款方式")
Text3.Text = Adodc1.Recordset.Fields("年龄")
Text4.Text = Adodc1.Recordset.Fields("联系地址")
DTPicker1.Value = Adodc1.Recordset.Fields("出生日期")
Text5.Text = Adodc1.Recordset.Fields("联系电话")
Text6.Text = Adodc1.Recordset.Fields("主要诊断")
Combo3.Text = Adodc1.Recordset.Fields("收入科室")
DTPicker2.Value = Adodc1.Recordset.Fields("入院时间")
Text7.Text = Adodc1.Recordset.Fields("主治医师")
Text8.Text = Adodc1.Recordset.Fields("备注")
Cmd_save.Enabled = True
Cmd_edit.Enabled = False
Else
MsgBox "没有此信息", 64, "医院住院管理系统"
End If
End If
End If
End Sub
Private Sub Cmd_save_Click()
Call main
If Text1.Text = "" Or Text11.Text = "" Then
MsgBox "住院号或者病房号不能为空", 64, "医院住院管理系统"
Else
If Cmd_add.Enabled = False Then
Adodc1.RecordSource = "select * from Table_zyxx where 住院号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "此人的住院信息已经保存!!", 64, "医院住院管理系统"
Else
Set adoRs = adoCon.Execute("UPDATE Table_bfxx SET 是否使用= 1 where 病房号='" + Text11.Text + "'")
Set adoRs = adoCon.Execute("insert into Table_zyxx values(" & Text1 & ",'" & Text10 & "','" & Text2 & "','" & Combo1 & "','" & DTPicker1 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Combo2 & "','" & DTPicker2 & "','" & Text7 & "','" & Combo3 & "','" & Check1 & "','" & Check2 & "','" & Text11 & "','" & Text9 & "','" & Text8 & "')")
MsgBox "数据保存成功!!", 64, "医院住院管理系统"
Adodc1.Refresh
Cmd_add.Enabled = True
Cmd_edit.Enabled = True
Cmd_save.Enabled = False
End If
ElseIf Cmd_edit.Enabled = False Then
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_zyxx values(" & Text1 & ",'" & Text10 & "','" & Text2 & "','" & Combo1 & "','" & DTPicker1 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Combo2 & "','" & DTPicker2 & "','" & Text7 & "','" & Combo3 & "','" & Check1 & "','" & Check2 & "','" & Text11 & "','" & Text9 & "','" & Text8 & "')")
Adodc1.Refresh
Cmd_edit.Enabled = True
Cmd_add.Enabled = True
Cmd_save.Enabled = False
Else
End If
End If
adoCon.Close
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker2.SetFocus
Else
End If
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub
Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Adodc2.RecordSource = "select * from Table_ksb order by 科室部门编号"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Do While Adodc2.Recordset.EOF = False
Combo3.AddItem (Adodc2.Recordset.Fields("科室部门名称"))
Adodc2.Recordset.MoveNext
Loop
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker2.Value = Date
If Cmd_add.Enabled = True Then
Exit Sub
ElseIf Cmd_add.Enabled = False Then
If Text1.Text = "" Then
frm_zyxx_temp.Show
frm_zyxx_temp.DataGrid1.SetFocus
Else
Adodc3.RecordSource = "select * from View_zyxx where 住院号='" + Text1.Text + "'"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
Text1.Text = Adodc3.Recordset.Fields("住院号")
Text2.Text = Adodc3.Recordset.Fields("姓名")
Combo1.Text = Adodc3.Recordset.Fields("性别")
DTPicker1.Value = Adodc3.Recordset.Fields("出生日期")
Text3.Text = Adodc3.Recordset.Fields("年龄")
Text4.Text = Adodc3.Recordset.Fields("家庭地址")
Text5.Text = Adodc3.Recordset.Fields("联系电话")
Text6.Text = Adodc3.Recordset.Fields("主要诊断")
Text10.Text = Adodc3.Recordset.Fields("挂号单号")
Text7.Text = Adodc3.Recordset.Fields("主治医师")
Text11.SetFocus
Else
MsgBox "没有相关的信息", 64, "医院住院管理系统"
End If
End If
Else
End If
Else
End If
End Sub
Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_bf_temp.Show
frm_bf_temp.DataGrid1.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo3.SetFocus
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text8.SetFocus
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -