📄 frm_bfwh.frm
字号:
End
Begin VB.ComboBox Combo2
BackColor = &H00C0C0FF&
Height = 300
ItemData = "frm_bfwh.frx":0015
Left = 720
List = "frm_bfwh.frx":0025
TabIndex = 9
Top = 600
Width = 2415
End
Begin VB.ComboBox Combo1
BackColor = &H00C0C0FF&
Height = 300
ItemData = "frm_bfwh.frx":005F
Left = 4080
List = "frm_bfwh.frx":0061
TabIndex = 7
Top = 240
Width = 1335
End
Begin VB.TextBox Text2
BackColor = &H00C0C0FF&
Height = 300
Left = 2640
TabIndex = 5
Top = 240
Width = 495
End
Begin VB.TextBox Text1
BackColor = &H00C0C0FF&
Height = 300
Left = 720
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.Label Label6
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "备注"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 12
Top = 1080
Width = 495
End
Begin VB.Label Label5
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "负责人"
ForeColor = &H00C00000&
Height = 375
Left = 3240
TabIndex = 10
Top = 720
Width = 615
End
Begin VB.Label Label4
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "类别"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 8
Top = 720
Width = 615
End
Begin VB.Label Label3
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "所属科室"
ForeColor = &H00C00000&
Height = 375
Left = 3240
TabIndex = 6
Top = 360
Width = 735
End
Begin VB.Label Label2
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "床位数"
ForeColor = &H00C00000&
Height = 255
Left = 1920
TabIndex = 4
Top = 360
Width = 735
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "病房号"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 855
End
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 255
Left = 720
TabIndex = 19
Top = 2160
Width = 1335
End
End
Attribute VB_Name = "frm_bfwh"
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_bfxx order by 病房号"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Val(Adodc1.Recordset.Fields("病房号")) + 1
Else
Text1.Text = 100
End If
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Text2.SetFocus
Cmd_save.Enabled = True
Cmd_add.Enabled = False
End Sub
Private Sub Cmd_cancel_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Cmd_add.Enabled = True
Cmd_save.Enabled = False
Cmd_edit.Enabled = True
Adodc1.RecordSource = "select * from Table_bfxx"
Adodc1.Refresh
Text2.SetFocus
End Sub
Private Sub Cmd_del_Click()
If Adodc1.Recordset.EOF = False Then
If Adodc1.Recordset.Fields("是否使用") = 1 Then
MsgBox "此病房正在使用中,不能够进行删除", 48, "医院住院管理系统"
Else
c = MsgBox("您确认要删除信息吗?", 17, "医院住院管理系统")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
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_bfxx where 病房号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
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("备注")
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 = "" Then
MsgBox "病房号不能为空", 64, "医院住院管理系统"
Else
If Cmd_add.Enabled = False Then
Set adoRs = adoCon.Execute("insert into Table_bfxx values(" & Text1 & ",'" & Combo1 & "','" & Combo2 & "','" & Text3 & "','" & Text2 & "','" & Check1 & "','" & Text4 & "')")
MsgBox "数据保存成功!!", 64, "医院住院管理系统"
Adodc1.Refresh
Cmd_add.Enabled = True
Cmd_edit.Enabled = True
Cmd_save.Enabled = False
ElseIf Cmd_edit.Enabled = False Then
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_bfxx values(" & Text1 & ",'" & Combo1 & "','" & Combo2 & "','" & Text3 & "','" & Text2 & "','" & Check1 & "','" & Text4 & "')")
MsgBox "数据修改成功!!", 64, "医院住院管理系统"
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 Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub DTPicker1_Click()
Text5.Text = DTPicker1.Value
End Sub
Private Sub DataGrid2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc1.RecordSource = "select * from Table_ryxxb"
'Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text3.Text = Adodc1.Recordset.Fields("姓名")
Text4.SetFocus
DataGrid2.Visible = False
Else
DataGrid2.Visible = False
End If
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
Combo1.AddItem (Adodc2.Recordset.Fields("科室部门名称"))
Adodc2.Recordset.MoveNext
Loop
Else
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Not IsNumeric(Text1.Text) Then
MsgBox "输入必须为数字"
Text1.Text = ""
Text1.SetFocus
Else
End If
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1.SetFocus
Else
End If
End Sub
'Private Sub Text3_Change()
'frm_ywryxx.Adodc1.RecordSource = "select * from Table_ryxxb where 姓名 like '%" + Text3.Text + "%'"
'frm_ywryxx.Adodc1.Refresh
'If frm_ywryxx.Adodc1.Recordset.RecordCount > 0 Then
'frm_ywryxx.Show
'Text3.SetFocus
'frm_ywryxx.DataGrid1.SetFocus
'Else
'Text3.SetFocus
'End If
'End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_ywryxx.Show
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -