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

📄 frm_ywrywh.frm

📁 可运行的一个医院住院管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Left            =   5880
         TabIndex        =   7
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "性别"
         Height          =   255
         Left            =   4560
         TabIndex        =   5
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "姓名"
         Height          =   255
         Left            =   2520
         TabIndex        =   3
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "人员编号"
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   480
      Top             =   4440
      Width           =   3975
      _ExtentX        =   7011
      _ExtentY        =   661
      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_ryxxb"
      Caption         =   "Adodc1"
      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.Label Label9 
      Height          =   375
      Left            =   960
      TabIndex        =   18
      Top             =   3120
      Width           =   1215
   End
   Begin VB.Menu FILE 
      Caption         =   "文件"
      Visible         =   0   'False
      Begin VB.Menu ADD 
         Caption         =   "增加"
      End
      Begin VB.Menu DEL 
         Caption         =   "删除"
      End
      Begin VB.Menu EDIT 
         Caption         =   "修改"
      End
      Begin VB.Menu AA 
         Caption         =   "-"
      End
      Begin VB.Menu SAVE 
         Caption         =   "保存"
      End
      Begin VB.Menu CANCEL 
         Caption         =   "取消"
      End
   End
End
Attribute VB_Name = "frm_ywrywh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim c
Private Sub ADD_Click()
Label9.Caption = 0
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo1.Text = ""
Text1.SetFocus
End Sub

Private Sub CANCEL_Click()
Call ADD_Click
End Sub

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub

Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
frm_ywrywh.PopupMenu FILE, 2
Else
End If
End Sub

Private Sub 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 EDIT_Click()
Label9.Caption = 1
MsgBox "请在人员编号文本框中输入所要修改医务人员的人员编号,然后再按回车键进行修改信息", 64, "医院住院管理系统"
Text1.SetFocus
End Sub

Private Sub Form_Load()
Label9.Caption = 0
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Adodc1.RecordSource = "select * from Table_ryxxb order by 人员编号"
Adodc1.Refresh
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
frm_ywrywh.PopupMenu FILE, 2
Else
End If
End Sub

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
frm_ywrywh.PopupMenu FILE, 2
Else
End If
End Sub

Private Sub SAVE_Click()
Call main
If Text1.Text = "" Then
MsgBox "人员编号不能为空", 64, "医院住院管理系统"
Else
If Label9.Caption = 0 Then
  Set adoRs = adoCon.Execute("insert into Table_ryxxb values(" & Text1 & ",'" & Text2 & "','" & Combo1 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "')")
  MsgBox "数据保存成功!!", 64, "医院住院管理系统"
  Adodc1.Refresh
  ElseIf Label9.Caption = 1 Then
  Adodc1.Recordset.Delete
  Set adoRs = adoCon.Execute("insert into Table_ryxxb values(" & Text1 & ",'" & Text2 & "','" & Combo1 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "')")
  MsgBox "数据修改成功!!", 64, "医院住院管理系统"
  Adodc1.Refresh
  Else
  End If
End If
    Adodc1.RecordSource = "select * from Table_ryxxb order by 人员编号"
    Adodc1.Refresh
adoCon.Close
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Text1.Text = "" Then
MsgBox "请输入所要修改的医务人员的人员编号信息", 64, "医院住院管理系统"
Else
    If Not IsNumeric(Text1.Text) Then
    MsgBox "输入必须为数字"
    Text1.Text = ""
    Text1.SetFocus
    Else
    If Label9.Caption = 0 Then
    Text2.SetFocus
    ElseIf Label9.Caption = 1 Then
    Text1.Locked = False
    Adodc1.RecordSource = "select * from Table_ryxxb 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("性别")
    Text3.Text = Adodc1.Recordset.Fields("年龄")
    Text4.Text = Adodc1.Recordset.Fields("职称")
    Text5.Text = Adodc1.Recordset.Fields("职务")
    Text6.Text = Adodc1.Recordset.Fields("所属科室")
    Text7.Text = Adodc1.Recordset.Fields("备注")
    Text2.SetFocus
    Else
    MsgBox "没有关于此人员编号的信息", 64, "医院住院管理系统"
    Text1.SetFocus
    End If
    End If
    End If
End If
Else
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_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    If Not IsNumeric(Text3.Text) Then
    MsgBox "输入必须为数字"
    Text3.Text = ""
    Text3.SetFocus
    Else
Text4.SetFocus
End If
Else
End If
End Sub

Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub

Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
Else
End If
End Sub

Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub

⌨️ 快捷键说明

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