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

📄 frm_zyxx_cx.frm

📁 可运行的一个医院住院管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_zyxx_cx 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "住院查询"
   ClientHeight    =   630
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5415
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   630
   ScaleWidth      =   5415
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "输入或选择查询条件后按回车键进行查询"
      ForeColor       =   &H00C00000&
      Height          =   615
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5415
      Begin VB.ComboBox Combo2 
         Height          =   300
         ItemData        =   "frm_zyxx_cx.frx":0000
         Left            =   2640
         List            =   "frm_zyxx_cx.frx":0016
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   220
         Width           =   735
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "frm_zyxx_cx.frx":0037
         Left            =   960
         List            =   "frm_zyxx_cx.frx":0059
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   220
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Left            =   3480
         TabIndex        =   4
         Top             =   220
         Width           =   1815
      End
      Begin MSComCtl2.DTPicker DT1 
         Height          =   300
         Left            =   3480
         TabIndex        =   5
         Top             =   240
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   529
         _Version        =   393216
         Format          =   30015489
         CurrentDate     =   38212
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "查询条件"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   975
      End
   End
End
Attribute VB_Name = "frm_zyxx_cx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, a
Dim b


Private Sub Combo1_Click()
If Combo1.Text = "入院时间" Or Combo1.Text = "出院时间" Then
Text1.Visible = False
DT1.Visible = True
Else
Text1.Visible = True
DT1.Visible = False
End If
End Sub

Private Sub Combo2_Click()
If Combo2.Text <> " Like" Then
i = 0
ElseIf Combo2.Text = " Like" Then
i = 1
Else
End If
If Combo1.Text = "入院时间" Or Combo1.Text = "出院时间" Then
DT1.SetFocus
Else
Text1.SetFocus
End If
End Sub

Private Sub DT1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
b = Str(DT1.Value)
If i = 0 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
ElseIf i = 1 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "<'" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
ElseIf i = 2 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "<='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
ElseIf i = 3 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + ">'" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
ElseIf i = 4 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + ">='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
ElseIf i = 5 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " like '%" + b + "%'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查询"
Else
MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
End If
Else
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
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = 13 Then
      If Text1.Text = "" Then
          MsgBox "输入不能为空"
      Else
          If Combo1.Text = "住院号" And Not IsNumeric(Text1.Text) Then
              Text1.Text = ""
              Text1.SetFocus
              MsgBox "输入必须为数字"
          Else
              a = Text1.Text
                  If i = 0 Then
                      frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " " + Combo2.Text + " '" + a + "' and 是否出院=0"
                      frm_cxjg.Adodc1.Refresh
                          If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
                              frm_cxjg.Show
                              frm_cxjg.DataGrid1.Visible = True
                              frm_cxjg.DataGrid2.Visible = False
                              frm_cxjg.DataGrid3.Visible = False
                              frm_cxjg.DataGrid4.Visible = False
                              frm_cxjg.DataGrid5.Visible = False
                              frm_cxjg.Caption = "住院查询"
                          Else
                              MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
                          End If
                   ElseIf i = 1 Then
                       frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " like '%" + a + "%' and 是否出院=0"
                       frm_cxjg.Adodc1.Refresh
                            If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
                                frm_cxjg.Show
                                frm_cxjg.DataGrid1.Visible = True
                                frm_cxjg.DataGrid2.Visible = False
                                frm_cxjg.DataGrid3.Visible = False
                                frm_cxjg.DataGrid4.Visible = False
                                frm_cxjg.DataGrid5.Visible = False
                                frm_cxjg.Caption = "住院查询"
                            Else
                                MsgBox "没有您要查询的相关信息", 64, "医院住院管理系统"
                            End If
                   Else
                   End If
         End If
      End If
  Else
  End If
End Sub

⌨️ 快捷键说明

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