?? form1.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 = "鐵東區(qū)婦幼保健院信息管理系統(tǒng)"
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 = "數(shù)據(jù)顯示信息"
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 = "庫存統(tǒng)計表"
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 '結(jié)束日期
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 狀態(tài)='入庫' AND 時間>='" & v_kaishi & "' THEN 數(shù)量 ELSE 0 END) AS 入庫,SUM(CASE WHEN 狀態(tài)='損耗' AND 時間>='" & v_kaishi & "' THEN 數(shù)量 ELSE 0 END) AS 損耗,SUM(CASE WHEN 狀態(tài)='出庫' AND 時間>='" & v_kaishi & "' THEN 數(shù)量 ELSE 0 END) AS 出庫,SUM(CASE WHEN 時間 ='" & v_yue & "' THEN 上月庫存 ELSE 0 END) AS 上月庫存"
sql = sql & ",(SUM(CASE WHEN 狀態(tài)='入庫' AND 時間>='" & yue & "' THEN 數(shù)量 ELSE 0 END)-SUM(CASE WHEN 狀態(tài)='出庫' AND 時間>='" & v_yue & "' THEN 數(shù)量 ELSE 0 END)-SUM(CASE WHEN 狀態(tài)='損耗' AND 時間>='" & v_yue & "' THEN 數(shù)量 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, "系統(tǒng)提示!")
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = db
Adodc1.RecordSource = sql
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -