⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_blgl_edit.frm

📁 一个简单的病例管理系统 分享一下 用VB编写的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Left            =   6480
      TabIndex        =   14
      Top             =   120
      Width           =   1815
   End
   Begin VB.Label lab_blh 
      BackStyle       =   0  'Transparent
      Caption         =   "100000001"
      ForeColor       =   &H000000C0&
      Height          =   255
      Left            =   4440
      TabIndex        =   13
      Top             =   120
      Width           =   1095
   End
End
Attribute VB_Name = "frm_blgl_edit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cmd_ok_Click()



If frm_blgl_main.Text1.Text = "add" Then
'========================
Adodc1.RecordSource = "select * from blgl "
Adodc1.Refresh
'===========================
'=============================================
'=============================================
 
   With Adodc1.Recordset
    
     If txt_xm.Text <> "" Then
    .AddNew
    !病历号 = lab_blh.Caption
    !姓名 = txt_xm.Text
    !性别 = cob_xb.Text
    !年龄 = txt_nl.Text
    !病区号 = txt_bqh.Text
    !床位号 = txt_cwh.Text
    !就诊科室 = txt_jzks.Text
    !申请医师 = txt_sqys.Text
    !诊断医师 = txt_zdys.Text
    !就诊时间 = lab_date.Caption
    !住院号 = txt_zyh.Text
    !住院时间 = txt_zysj.Text
    !初复诊 = cob_cfz.Text
    !联系电话 = txt_lxdh.Text
    !从事职业 = txt_cszy.Text
    !联系地址 = txt_lxdz.Text
    !工作单位 = txt_gzdw.Text
    !病人主诉 = txt_brzs.Text + " "
    !用药情况 = txt_yyqk.Text + " "
    !即往病史 = txt_jwbs.Text + " "
    !临床诊断 = txt_lczd.Text + " "
     .Update
     
         MsgBox "病人病历已经建立!", vbOKOnly, "迅捷软件--病历管理"
     Load frm_blgl_main
     frm_blgl_main.Show
     Unload Me
   Else
    MsgBox "请输入病人姓名!", vbOKOnly, "迅捷软件--病历管理-数据错误"
      txt_xm.SetFocus
     Exit Sub
    End If
  End With
  End If
  If frm_blgl_main.Text1 = "edit" Then
  '========================
Adodc1.RecordSource = "select * from blgl where 病历号 = '" + frm_blgl_main.Adodc1.Recordset("病历号") + "'"
Adodc1.Refresh
'===========================
'=============================================
'=============================================
 
   With Adodc1.Recordset
    
     If txt_xm.Text <> "" Then
    !病历号 = lab_blh.Caption
    !姓名 = txt_xm.Text
    !性别 = cob_xb.Text
    !年龄 = txt_nl.Text
    !病区号 = txt_bqh.Text
    !床位号 = txt_cwh.Text
    !就诊科室 = txt_jzks.Text
    !申请医师 = txt_sqys.Text
    !诊断医师 = txt_zdys.Text
    !就诊时间 = lab_date.Caption
    !住院号 = txt_zyh.Text
    !住院时间 = txt_zysj.Text
    !初复诊 = cob_cfz.Text
    !联系电话 = txt_lxdh.Text
    !从事职业 = txt_cszy.Text
    !联系地址 = txt_lxdz.Text
    !工作单位 = txt_gzdw.Text
    !病人主诉 = txt_brzs.Text
    !用药情况 = txt_yyqk.Text
    !即往病史 = txt_jwbs.Text
    !临床诊断 = txt_lczd.Text
     .Update
     
         MsgBox "病人病历已经修改!", vbOKOnly, "迅捷软件--病历管理"
         Load frm_blgl_main
     frm_blgl_main.Show
     Unload Me
   Else
    MsgBox "请输入病人姓名!", vbOKOnly, "迅捷软件--病历管理-数据错误"
      txt_xm.SetFocus
     Exit Sub
    End If
  End With
  End If
End Sub





Private Sub cob_cfz_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_lxdh.SetFocus
End If
End Sub

Private Sub cob_xb_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_nl.SetFocus
End If
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Form_Activate()
Dim mydate As String
mydate = Date
Dim mytime As String
mytime = Time
'========================

'===========================
If frm_blgl_main.Text1.Text = "add" Then
lab_date.Caption = mydate + " " + mytime
txt_zysj.Text = mydate + " " + mytime
If Not (frm_blgl_main.Adodc1.Recordset.EOF Or frm_blgl_main.Adodc1.Recordset.BOF) Then
Dim datapath As String
datapath = App.Path & "\"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + datapath + "bl_blgl.mdb"
Adodc1.RecordSource = "select * from blgl order by 病历号"
Adodc1.Refresh
Adodc1.Recordset.MoveLast
lab_blh.Caption = Adodc1.Recordset("病历号") + 1
Else
lab_blh.Caption = "100000001"
End If
cob_xb.ListIndex = 0
cob_cfz.ListIndex = 0
End If
If frm_blgl_main.Text1.Text = "edit" Then
lab_blh.Caption = frm_blgl_main.Adodc1.Recordset("病历号") & ""
lab_date.Caption = frm_blgl_main.Adodc1.Recordset("就诊时间") & ""
txt_xm.Text = frm_blgl_main.Adodc1.Recordset("姓名") & ""
cob_xb.Text = frm_blgl_main.Adodc1.Recordset("性别") & ""
txt_nl.Text = frm_blgl_main.Adodc1.Recordset("年龄") & ""
txt_bqh.Text = frm_blgl_main.Adodc1.Recordset("病区号") & ""
txt_cwh.Text = frm_blgl_main.Adodc1.Recordset("床位号") & ""
txt_jzks.Text = frm_blgl_main.Adodc1.Recordset("就诊科室") & ""
txt_sqys.Text = frm_blgl_main.Adodc1.Recordset("申请医师") & ""
txt_zdys.Text = frm_blgl_main.Adodc1.Recordset("诊断医师") & ""
txt_zyh.Text = frm_blgl_main.Adodc1.Recordset("住院号") & ""
txt_zysj.Text = frm_blgl_main.Adodc1.Recordset("住院时间") & ""
cob_cfz.Text = frm_blgl_main.Adodc1.Recordset("初复诊") & ""
txt_lxdh.Text = frm_blgl_main.Adodc1.Recordset("联系电话") & ""
txt_cszy.Text = frm_blgl_main.Adodc1.Recordset("从事职业") & ""
txt_lxdz.Text = frm_blgl_main.Adodc1.Recordset("联系地址") & ""
txt_gzdw.Text = frm_blgl_main.Adodc1.Recordset("工作单位") & ""
txt_brzs.Text = frm_blgl_main.Adodc1.Recordset("病人主诉") & ""
txt_yyqk.Text = frm_blgl_main.Adodc1.Recordset("用药情况") & ""
txt_jwbs.Text = frm_blgl_main.Adodc1.Recordset("即往病史") & ""
txt_lczd.Text = frm_blgl_main.Adodc1.Recordset("临床诊断") & ""
End If
If frm_blgl_main.Text1.Text = "more" Then
lab_blh.Caption = frm_blgl_main.Adodc1.Recordset("病历号") & ""
lab_date.Caption = frm_blgl_main.Adodc1.Recordset("就诊时间") & ""
txt_xm.Text = frm_blgl_main.Adodc1.Recordset("姓名") & ""
cob_xb.Text = frm_blgl_main.Adodc1.Recordset("性别") & ""
txt_nl.Text = frm_blgl_main.Adodc1.Recordset("年龄") & ""
txt_bqh.Text = frm_blgl_main.Adodc1.Recordset("病区号") & ""
txt_cwh.Text = frm_blgl_main.Adodc1.Recordset("床位号") & ""
txt_jzks.Text = frm_blgl_main.Adodc1.Recordset("就诊科室") & ""
txt_sqys.Text = frm_blgl_main.Adodc1.Recordset("申请医师") & ""
txt_zdys.Text = frm_blgl_main.Adodc1.Recordset("诊断医师") & ""
txt_zyh.Text = frm_blgl_main.Adodc1.Recordset("住院号") & ""
txt_zysj.Text = frm_blgl_main.Adodc1.Recordset("住院时间") & ""
cob_cfz.Text = frm_blgl_main.Adodc1.Recordset("初复诊") & ""
txt_lxdh.Text = frm_blgl_main.Adodc1.Recordset("联系电话") & ""
txt_cszy.Text = frm_blgl_main.Adodc1.Recordset("从事职业") & ""
txt_lxdz.Text = frm_blgl_main.Adodc1.Recordset("联系地址") & ""
txt_gzdw.Text = frm_blgl_main.Adodc1.Recordset("工作单位") & ""
txt_brzs.Text = frm_blgl_main.Adodc1.Recordset("病人主诉") & ""
txt_yyqk.Text = frm_blgl_main.Adodc1.Recordset("用药情况") & ""
txt_jwbs.Text = frm_blgl_main.Adodc1.Recordset("即往病史") & ""
txt_lczd.Text = frm_blgl_main.Adodc1.Recordset("临床诊断") & ""
cmd_ok.Visible = False
End If
End Sub

Private Sub Form_Load()
Dim mydate As String
mydate = Date
Dim mytime As String
mytime = Time
'========================
Dim datapath As String
datapath = App.Path & "\"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + datapath + "bl_blgl.mdb"
Adodc1.RecordSource = "select * from blgl "
Adodc1.Refresh
'===========================
If frm_blgl_main.Text1.Text = "add" Then
lab_date.Caption = mydate + " " + mytime
txt_zysj.Text = mydate + " " + mytime
If Not (frm_blgl_main.Adodc1.Recordset.EOF Or frm_blgl_main.Adodc1.Recordset.BOF) Then
Adodc1.RecordSource = "select * from blgl order by 病历号"
Adodc1.Refresh
Adodc1.Recordset.MoveLast
lab_blh.Caption = Adodc1.Recordset("病历号") + 1
Else
lab_blh.Caption = "1000000001"
End If


End If
If frm_blgl_main.Text1.Text = "edit" Then
lab_blh.Caption = frm_blgl_main.Adodc1.Recordset("病历号") & ""
lab_date.Caption = frm_blgl_main.Adodc1.Recordset("就诊时间") & ""
txt_xm.Text = frm_blgl_main.Adodc1.Recordset("姓名") & ""
cob_xb.Text = frm_blgl_main.Adodc1.Recordset("性别") & ""
txt_nl.Text = frm_blgl_main.Adodc1.Recordset("年龄") & ""
txt_bqh.Text = frm_blgl_main.Adodc1.Recordset("病区号") & ""
txt_cwh.Text = frm_blgl_main.Adodc1.Recordset("床位号") & ""
txt_jzks.Text = frm_blgl_main.Adodc1.Recordset("就诊科室") & ""
txt_sqys.Text = frm_blgl_main.Adodc1.Recordset("申请医师") & ""
txt_zdys.Text = frm_blgl_main.Adodc1.Recordset("诊断医师") & ""
txt_zyh.Text = frm_blgl_main.Adodc1.Recordset("住院号") & ""
cob_cfz.Text = frm_blgl_main.Adodc1.Recordset("初复诊") & ""
txt_lxdh.Text = frm_blgl_main.Adodc1.Recordset("联系电话") & ""
txt_cszy.Text = frm_blgl_main.Adodc1.Recordset("从事职业") & ""
txt_lxdz.Text = frm_blgl_main.Adodc1.Recordset("联系地址") & ""
txt_gzdw.Text = frm_blgl_main.Adodc1.Recordset("工作单位") & ""
txt_brzs.Text = frm_blgl_main.Adodc1.Recordset("病人主诉") & ""
txt_yyqk.Text = frm_blgl_main.Adodc1.Recordset("用药情况") & ""
txt_jwbs.Text = frm_blgl_main.Adodc1.Recordset("即往病史") & ""
txt_lczd.Text = frm_blgl_main.Adodc1.Recordset("临床诊断") & ""
End If
If frm_blgl_main.Text1.Text = "more" Then
lab_blh.Caption = frm_blgl_main.Adodc1.Recordset("病历号") & ""
lab_date.Caption = frm_blgl_main.Adodc1.Recordset("就诊时间") & ""
txt_xm.Text = frm_blgl_main.Adodc1.Recordset("姓名") & ""
cob_xb.Text = frm_blgl_main.Adodc1.Recordset("性别") & ""
txt_nl.Text = frm_blgl_main.Adodc1.Recordset("年龄") & ""
txt_bqh.Text = frm_blgl_main.Adodc1.Recordset("病区号") & ""
txt_cwh.Text = frm_blgl_main.Adodc1.Recordset("床位号") & ""
txt_jzks.Text = frm_blgl_main.Adodc1.Recordset("就诊科室") & ""
txt_sqys.Text = frm_blgl_main.Adodc1.Recordset("申请医师") & ""
txt_zdys.Text = frm_blgl_main.Adodc1.Recordset("诊断医师") & ""
txt_zyh.Text = frm_blgl_main.Adodc1.Recordset("住院号") & ""
cob_cfz.Text = frm_blgl_main.Adodc1.Recordset("初复诊") & ""
txt_lxdh.Text = frm_blgl_main.Adodc1.Recordset("联系电话") & ""
txt_cszy.Text = frm_blgl_main.Adodc1.Recordset("从事职业") & ""
txt_lxdz.Text = frm_blgl_main.Adodc1.Recordset("联系地址") & ""
txt_gzdw.Text = frm_blgl_main.Adodc1.Recordset("工作单位") & ""
txt_brzs.Text = frm_blgl_main.Adodc1.Recordset("病人主诉") & ""
txt_yyqk.Text = frm_blgl_main.Adodc1.Recordset("用药情况") & ""
txt_jwbs.Text = frm_blgl_main.Adodc1.Recordset("即往病史") & ""
txt_lczd.Text = frm_blgl_main.Adodc1.Recordset("临床诊断") & ""
cmd_ok.Visible = False
End If
End Sub







Private Sub txt_bqh_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_cwh.SetFocus
End If
End Sub



Private Sub txt_brzs_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_lczd.SetFocus
End If
End Sub

Private Sub txt_cszy_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_gzdw.SetFocus
End If
End Sub





Private Sub txt_cwh_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_zysj.SetFocus
txt_zysj.SelStart = 0
txt_zysj.SelLength = Len(txt_zysj.Text)
End If
End Sub

Private Sub txt_gzdw_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_zyh.SetFocus
End If
End Sub



Private Sub txt_jwbs_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmd_ok.SetFocus
End If
End Sub

Private Sub txt_jzks_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_sqys.SetFocus
End If
End Sub




Private Sub txt_lczd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_yyqk.SetFocus
End If
End Sub

Private Sub txt_lxdh_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_lxdz.SetFocus
End If
End Sub


Private Sub txt_lxdz_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_cszy.SetFocus
End If
End Sub

Private Sub txt_nl_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_jzks.SetFocus
End If
End Sub


Private Sub txt_sqys_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_zdys.SetFocus
txt_zdys.Text = txt_sqys.Text
txt_zdys.SelStart = 0
txt_zdys.SelLength = Len(txt_zdys.Text)
End If

End Sub

Private Sub txt_xm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cob_xb.SetFocus
End If
End Sub


Private Sub txt_yyqk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_jwbs.SetFocus
End If
End Sub

Private Sub txt_zdys_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cob_cfz.SetFocus
End If
End Sub


Private Sub txt_zyh_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_bqh.SetFocus
End If
End Sub



Private Sub txt_zysj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt_brzs.SetFocus
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -