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

📄 form1.frm

📁 小型医院管理
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form wp_cun_cout 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "铁东区妇幼保健院信息管理系统"
   ClientHeight    =   7230
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8880
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7230
   ScaleWidth      =   8880
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox wp_type 
      Height          =   300
      ItemData        =   "Form1.frx":0000
      Left            =   1320
      List            =   "Form1.frx":000A
      TabIndex        =   8
      Text            =   "请选择"
      Top             =   720
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "数据显示信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   5895
      Left            =   120
      TabIndex        =   1
      Top             =   1200
      Width           =   8655
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   375
         Left            =   1560
         Top             =   4560
         Visible         =   0   'False
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   661
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         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 MSDataGridLib.DataGrid DataGrid1 
         Height          =   5415
         Left            =   120
         TabIndex        =   7
         Top             =   360
         Width           =   8415
         _ExtentX        =   14843
         _ExtentY        =   9551
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   6
         BeginProperty Column00 
            DataField       =   "名称"
            Caption         =   "物品名称"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "入库"
            Caption         =   "入库"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "出库"
            Caption         =   "出库"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "损耗"
            Caption         =   "损耗"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "上月库存"
            Caption         =   "上月库存"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "库存"
            Caption         =   "库存"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "0"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   1
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               ColumnWidth     =   1200.189
            EndProperty
            BeginProperty Column01 
               ColumnWidth     =   705.26
            EndProperty
            BeginProperty Column02 
               ColumnWidth     =   705.26
            EndProperty
            BeginProperty Column03 
               ColumnWidth     =   915.024
            EndProperty
            BeginProperty Column04 
            EndProperty
            BeginProperty Column05 
               ColumnWidth     =   1500.095
            EndProperty
         EndProperty
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "显  示"
      Default         =   -1  'True
      Height          =   375
      Left            =   7440
      TabIndex        =   0
      Top             =   720
      Width           =   1095
   End
   Begin MSComCtl2.DTPicker v_sj2 
      Height          =   375
      Left            =   5640
      TabIndex        =   2
      Top             =   720
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   661
      _Version        =   393216
      Format          =   23724033
      CurrentDate     =   38025
   End
   Begin MSComCtl2.DTPicker v_sj1 
      Height          =   375
      Left            =   3480
      TabIndex        =   3
      Top             =   720
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      _Version        =   393216
      Format          =   23724033
      CurrentDate     =   38025
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "类  别"
      Height          =   180
      Left            =   360
      TabIndex        =   9
      Top             =   840
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "时   间"
      Height          =   180
      Left            =   2640
      TabIndex        =   6
      Top             =   840
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "到"
      Height          =   180
      Left            =   5280
      TabIndex        =   5
      Top             =   840
      Width           =   180
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "库存统计表"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   360
      Left            =   3360
      TabIndex        =   4
      Top             =   120
      Width           =   1875
   End
End
Attribute VB_Name = "wp_cun_cout"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()



Dim sql As String



v_kaishi = v_sj1.Value  'v_kaishi
v_end = v_sj2.Visible   '结束日期


v_nian = Year(v_kaishi)
v_yue1 = Month(v_kaishi)
v_ri = Day(v_kaishi)


If v_ri <= 25 Then
v_yue = v_nian & "-" & v_yue1 - 1 & "-" & 26 '月初日
Else
v_yue = v_nian & "-" & v_yue1 & "-" & 26 '月初日
End If

'MsgBox (v_yue)

sql = "select 名称,SUM(CASE WHEN 状态='入库' AND 时间>='" & v_kaishi & "' THEN 数量 ELSE 0 END) AS 入库,SUM(CASE WHEN 状态='损耗' AND 时间>='" & v_kaishi & "' THEN 数量 ELSE 0 END) AS 损耗,SUM(CASE WHEN 状态='出库' AND 时间>='" & v_kaishi & "' THEN 数量 ELSE 0 END) AS 出库,SUM(CASE WHEN 时间 ='" & v_yue & "' THEN 上月库存 ELSE 0 END) AS 上月库存"
sql = sql & ",(SUM(CASE WHEN 状态='入库' AND 时间>='" & yue & "' THEN 数量 ELSE 0 END)-SUM(CASE WHEN 状态='出库' AND 时间>='" & v_yue & "' THEN 数量 ELSE 0 END)-SUM(CASE WHEN 状态='损耗' AND 时间>='" & v_yue & "' THEN 数量 ELSE 0 END)+SUM(CASE WHEN 时间 ='" & v_yue & "' THEN 上月库存 ELSE 0 END)) AS 库存 From 物品库存表 WHERE 时间 between '" & v_yue & "'and '" & v_sj2.Value & "' and 类别='" & Trim(wp_type.Text) & "' GROUP BY 名称"
 
 
Dim rs As New ADODB.Recordset
rs.Open sql, db

If Not rs.EOF Then
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = db
Adodc1.RecordSource = sql
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh


Else
b1 = MsgBox("警告, 没有选择记录!", vbQuestion, "系统提示!")
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = db
Adodc1.RecordSource = sql
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh


End If









End Sub

⌨️ 快捷键说明

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