-
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:48k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Begin VB.Form KF_SumInout 
  5.    Caption         =   "收发存汇总表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   1219001
  11.    Icon            =   "统计分析_收发存汇总.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.Toolbar GsToolbar 
  19.       Height          =   525
  20.       Left            =   9330
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   2475
  24.       _ExtentX        =   4366
  25.       _ExtentY        =   926
  26.       ButtonWidth     =   1455
  27.       ButtonHeight    =   926
  28.       Appearance      =   1
  29.       Style           =   1
  30.       ImageList       =   "ImageList2"
  31.       _Version        =   393216
  32.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  33.          NumButtons      =   3
  34.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  35.             Caption         =   "保存格式"
  36.             Key             =   "bcgs"
  37.             ImageKey        =   "bcgs"
  38.          EndProperty
  39.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  40.             Caption         =   "默认列宽"
  41.             Key             =   "hfmrgs"
  42.             ImageKey        =   "mrlk"
  43.          EndProperty
  44.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  45.             Caption         =   "显示项目"
  46.             Key             =   "szxsxm"
  47.             ImageKey        =   "xsxm"
  48.          EndProperty
  49.       EndProperty
  50.    End
  51.    Begin VB.PictureBox Pic_Title 
  52.       BackColor       =   &H00FFFFFF&
  53.       Height          =   1050
  54.       Left            =   0
  55.       Picture         =   "统计分析_收发存汇总.frx":1042
  56.       ScaleHeight     =   990
  57.       ScaleWidth      =   11715
  58.       TabIndex        =   1
  59.       Top             =   570
  60.       Width           =   11775
  61.       Begin VB.Label Label1 
  62.          AutoSize        =   -1  'True
  63.          BackStyle       =   0  'Transparent
  64.          Caption         =   "仓库名称:"
  65.          Height          =   195
  66.          Left            =   3450
  67.          TabIndex        =   6
  68.          Top             =   720
  69.          Width           =   765
  70.       End
  71.       Begin VB.Label Label2 
  72.          AutoSize        =   -1  'True
  73.          BackStyle       =   0  'Transparent
  74.          Caption         =   "会计期间:"
  75.          Height          =   180
  76.          Left            =   8340
  77.          TabIndex        =   5
  78.          Top             =   735
  79.          Width           =   810
  80.       End
  81.       Begin VB.Label Label3 
  82.          AutoSize        =   -1  'True
  83.          BackStyle       =   0  'Transparent
  84.          Caption         =   "仓库编码:"
  85.          Height          =   195
  86.          Left            =   675
  87.          TabIndex        =   4
  88.          Top             =   720
  89.          Width           =   765
  90.       End
  91.       Begin VB.Label Lab_Title 
  92.          BackColor       =   &H80000018&
  93.          BackStyle       =   0  'Transparent
  94.          Caption         =   "收发存汇总表"
  95.          BeginProperty Font 
  96.             Name            =   "宋体"
  97.             Size            =   12
  98.             Charset         =   134
  99.             Weight          =   700
  100.             Underline       =   0   'False
  101.             Italic          =   0   'False
  102.             Strikethrough   =   0   'False
  103.          EndProperty
  104.          ForeColor       =   &H00000000&
  105.          Height          =   300
  106.          Index           =   4
  107.          Left            =   480
  108.          TabIndex        =   2
  109.          Top             =   210
  110.          Width           =   2715
  111.       End
  112.    End
  113.    Begin VB.Timer Timer1 
  114.       Enabled         =   0   'False
  115.       Interval        =   1
  116.       Left            =   7620
  117.       Top             =   90
  118.    End
  119.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  120.       Height          =   7365
  121.       Left            =   0
  122.       TabIndex        =   0
  123.       Top             =   1650
  124.       Width           =   11775
  125.       _cx             =   5080
  126.       _cy             =   5080
  127.       Appearance      =   1
  128.       BorderStyle     =   1
  129.       Enabled         =   -1  'True
  130.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  131.          Name            =   "宋体"
  132.          Size            =   9
  133.          Charset         =   134
  134.          Weight          =   400
  135.          Underline       =   0   'False
  136.          Italic          =   0   'False
  137.          Strikethrough   =   0   'False
  138.       EndProperty
  139.       MousePointer    =   0
  140.       BackColor       =   16777215
  141.       ForeColor       =   -2147483640
  142.       BackColorFixed  =   13826538
  143.       ForeColorFixed  =   -2147483630
  144.       BackColorSel    =   -2147483635
  145.       ForeColorSel    =   -2147483634
  146.       BackColorBkg    =   -2147483636
  147.       BackColorAlternate=   16777215
  148.       GridColor       =   -2147483633
  149.       GridColorFixed  =   -2147483632
  150.       TreeColor       =   -2147483632
  151.       FloodColor      =   192
  152.       SheetBorder     =   -2147483642
  153.       FocusRect       =   1
  154.       HighLight       =   1
  155.       AllowSelection  =   -1  'True
  156.       AllowBigSelection=   -1  'True
  157.       AllowUserResizing=   0
  158.       SelectionMode   =   0
  159.       GridLines       =   1
  160.       GridLinesFixed  =   2
  161.       GridLineWidth   =   1
  162.       Rows            =   50
  163.       Cols            =   10
  164.       FixedRows       =   1
  165.       FixedCols       =   1
  166.       RowHeightMin    =   0
  167.       RowHeightMax    =   0
  168.       ColWidthMin     =   0
  169.       ColWidthMax     =   0
  170.       ExtendLastCol   =   0   'False
  171.       FormatString    =   ""
  172.       ScrollTrack     =   0   'False
  173.       ScrollBars      =   3
  174.       ScrollTips      =   0   'False
  175.       MergeCells      =   0
  176.       MergeCompare    =   0
  177.       AutoResize      =   -1  'True
  178.       AutoSizeMode    =   0
  179.       AutoSearch      =   0
  180.       AutoSearchDelay =   2
  181.       MultiTotals     =   -1  'True
  182.       SubtotalPosition=   1
  183.       OutlineBar      =   0
  184.       OutlineCol      =   0
  185.       Ellipsis        =   0
  186.       ExplorerBar     =   0
  187.       PicturesOver    =   0   'False
  188.       FillStyle       =   0
  189.       RightToLeft     =   0   'False
  190.       PictureType     =   0
  191.       TabBehavior     =   0
  192.       OwnerDraw       =   0
  193.       Editable        =   0
  194.       ShowComboButton =   1
  195.       WordWrap        =   0   'False
  196.       TextStyle       =   0
  197.       TextStyleFixed  =   0
  198.       OleDragMode     =   0
  199.       OleDropMode     =   0
  200.       DataMode        =   0
  201.       VirtualData     =   -1  'True
  202.       DataMember      =   ""
  203.       ComboSearch     =   3
  204.       AutoSizeMouse   =   -1  'True
  205.       FrozenRows      =   0
  206.       FrozenCols      =   0
  207.       AllowUserFreezing=   0
  208.       BackColorFrozen =   0
  209.       ForeColorFrozen =   0
  210.       WallPaperAlignment=   9
  211.       AccessibleName  =   ""
  212.       AccessibleDescription=   ""
  213.       AccessibleValue =   ""
  214.       AccessibleRole  =   24
  215.       Begin MSComctlLib.ImageList ImageList2 
  216.          Left            =   0
  217.          Top             =   0
  218.          _ExtentX        =   1005
  219.          _ExtentY        =   1005
  220.          BackColor       =   -2147483643
  221.          ImageWidth      =   16
  222.          ImageHeight     =   16
  223.          MaskColor       =   12632256
  224.          _Version        =   393216
  225.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  226.             NumListImages   =   40
  227.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  228.                Picture         =   "统计分析_收发存汇总.frx":1FAC4
  229.                Key             =   "sz"
  230.             EndProperty
  231.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  232.                Picture         =   "统计分析_收发存汇总.frx":1FE5E
  233.                Key             =   "dy"
  234.             EndProperty
  235.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  236.                Picture         =   "统计分析_收发存汇总.frx":201F8
  237.                Key             =   "yl"
  238.             EndProperty
  239.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  240.                Picture         =   "统计分析_收发存汇总.frx":20592
  241.                Key             =   "xg"
  242.             EndProperty
  243.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  244.                Picture         =   "统计分析_收发存汇总.frx":2092C
  245.                Key             =   "zh"
  246.             EndProperty
  247.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  248.                Picture         =   "统计分析_收发存汇总.frx":20CC6
  249.                Key             =   "sh"
  250.             EndProperty
  251.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  252.                Picture         =   "统计分析_收发存汇总.frx":21060
  253.                Key             =   "bc"
  254.             EndProperty
  255.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  256.                Picture         =   "统计分析_收发存汇总.frx":213FA
  257.                Key             =   "fq"
  258.             EndProperty
  259.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  260.                Picture         =   "统计分析_收发存汇总.frx":21794
  261.                Key             =   "bz"
  262.             EndProperty
  263.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  264.                Picture         =   "统计分析_收发存汇总.frx":21B2E
  265.                Key             =   "tc"
  266.             EndProperty
  267.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.                Picture         =   "统计分析_收发存汇总.frx":21EC8
  269.                Key             =   "bcgs"
  270.             EndProperty
  271.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  272.                Picture         =   "统计分析_收发存汇总.frx":22262
  273.                Key             =   "mrlk"
  274.             EndProperty
  275.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  276.                Picture         =   "统计分析_收发存汇总.frx":225FC
  277.                Key             =   "xsxm"
  278.             EndProperty
  279.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  280.                Picture         =   "统计分析_收发存汇总.frx":22996
  281.                Key             =   "first"
  282.             EndProperty
  283.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  284.                Picture         =   "统计分析_收发存汇总.frx":22D30
  285.                Key             =   "prev"
  286.             EndProperty
  287.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  288.                Picture         =   "统计分析_收发存汇总.frx":230CA
  289.                Key             =   "next"
  290.             EndProperty
  291.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  292.                Picture         =   "统计分析_收发存汇总.frx":23464
  293.                Key             =   "last"
  294.             EndProperty
  295.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  296.                Picture         =   "统计分析_收发存汇总.frx":237FE
  297.                Key             =   "xx"
  298.             EndProperty
  299.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  300.                Picture         =   "统计分析_收发存汇总.frx":23B98
  301.                Key             =   "define"
  302.             EndProperty
  303.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  304.                Picture         =   "统计分析_收发存汇总.frx":23F32
  305.                Key             =   "exec"
  306.             EndProperty
  307.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.                Picture         =   "统计分析_收发存汇总.frx":242CC
  309.                Key             =   "xz"
  310.             EndProperty
  311.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  312.                Picture         =   "统计分析_收发存汇总.frx":24666
  313.                Key             =   "sc"
  314.             EndProperty
  315.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  316.                Picture         =   "统计分析_收发存汇总.frx":24A00
  317.                Key             =   "sx"
  318.             EndProperty
  319.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  320.                Picture         =   "统计分析_收发存汇总.frx":24D9A
  321.                Key             =   "cx"
  322.             EndProperty
  323.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  324.                Picture         =   "统计分析_收发存汇总.frx":25134
  325.                Key             =   "zd"
  326.             EndProperty
  327.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  328.                Picture         =   "统计分析_收发存汇总.frx":254CE
  329.                Key             =   "dz"
  330.             EndProperty
  331.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  332.                Picture         =   "统计分析_收发存汇总.frx":25868
  333.                Key             =   "ph"
  334.             EndProperty
  335.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  336.                Picture         =   "统计分析_收发存汇总.frx":25C02
  337.                Key             =   "fz"
  338.             EndProperty
  339.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  340.                Picture         =   "统计分析_收发存汇总.frx":25F9C
  341.                Key             =   "dw"
  342.             EndProperty
  343.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  344.                Picture         =   "统计分析_收发存汇总.frx":26336
  345.                Key             =   "hf"
  346.             EndProperty
  347.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  348.                Picture         =   "统计分析_收发存汇总.frx":266D0
  349.                Key             =   "pz"
  350.             EndProperty
  351.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  352.                Picture         =   "统计分析_收发存汇总.frx":26A6A
  353.                Key             =   "check"
  354.             EndProperty
  355.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  356.                Picture         =   "统计分析_收发存汇总.frx":26E04
  357.                Key             =   "qs"
  358.             EndProperty
  359.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  360.                Picture         =   "统计分析_收发存汇总.frx":2719E
  361.                Key             =   "fullcheck"
  362.             EndProperty
  363.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  364.                Picture         =   "统计分析_收发存汇总.frx":27538
  365.                Key             =   "qq"
  366.             EndProperty
  367.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  368.                Picture         =   "统计分析_收发存汇总.frx":278D2
  369.                Key             =   "bcw"
  370.             EndProperty
  371.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  372.                Picture         =   "统计分析_收发存汇总.frx":27C6C
  373.                Key             =   "ye"
  374.             EndProperty
  375.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  376.                Picture         =   "统计分析_收发存汇总.frx":28006
  377.                Key             =   ""
  378.             EndProperty
  379.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  380.                Picture         =   "统计分析_收发存汇总.frx":283A0
  381.                Key             =   "frist"
  382.             EndProperty
  383.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  384.                Picture         =   "统计分析_收发存汇总.frx":2873A
  385.                Key             =   "dj"
  386.             EndProperty
  387.          EndProperty
  388.       End
  389.    End
  390.    Begin MSComctlLib.ImageList ImageList1 
  391.       Left            =   7110
  392.       Top             =   0
  393.       _ExtentX        =   1005
  394.       _ExtentY        =   1005
  395.       BackColor       =   -2147483643
  396.       ImageWidth      =   16
  397.       ImageHeight     =   16
  398.       MaskColor       =   12632256
  399.       _Version        =   393216
  400.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  401.          NumListImages   =   17
  402.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.             Picture         =   "统计分析_收发存汇总.frx":28AD4
  404.             Key             =   "sz"
  405.          EndProperty
  406.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.             Picture         =   "统计分析_收发存汇总.frx":28E6E
  408.             Key             =   "dy"
  409.          EndProperty
  410.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.             Picture         =   "统计分析_收发存汇总.frx":29208
  412.             Key             =   "yl"
  413.          EndProperty
  414.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.             Picture         =   "统计分析_收发存汇总.frx":295A2
  416.             Key             =   "cx"
  417.          EndProperty
  418.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.             Picture         =   "统计分析_收发存汇总.frx":2993C
  420.             Key             =   "dj"
  421.          EndProperty
  422.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.             Picture         =   "统计分析_收发存汇总.frx":29CD6
  424.             Key             =   "sx"
  425.          EndProperty
  426.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.             Picture         =   "统计分析_收发存汇总.frx":2A070
  428.             Key             =   "first"
  429.          EndProperty
  430.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.             Picture         =   "统计分析_收发存汇总.frx":2A40A
  432.             Key             =   "prev"
  433.          EndProperty
  434.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.             Picture         =   "统计分析_收发存汇总.frx":2A7A4
  436.             Key             =   "next"
  437.          EndProperty
  438.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.             Picture         =   "统计分析_收发存汇总.frx":2AB3E
  440.             Key             =   "last"
  441.          EndProperty
  442.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.             Picture         =   "统计分析_收发存汇总.frx":2AED8
  444.             Key             =   "bz"
  445.          EndProperty
  446.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.             Picture         =   "统计分析_收发存汇总.frx":2B272
  448.             Key             =   "tc"
  449.          EndProperty
  450.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.             Picture         =   "统计分析_收发存汇总.frx":2B60C
  452.             Key             =   "bcgs"
  453.          EndProperty
  454.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.             Picture         =   "统计分析_收发存汇总.frx":2B9A6
  456.             Key             =   "mrlk"
  457.          EndProperty
  458.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.             Picture         =   "统计分析_收发存汇总.frx":2BD40
  460.             Key             =   "xsxm"
  461.          EndProperty
  462.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.             Picture         =   "统计分析_收发存汇总.frx":2C0DA
  464.             Key             =   "mx"
  465.          EndProperty
  466.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.             Picture         =   "统计分析_收发存汇总.frx":2C474
  468.             Key             =   "hz"
  469.          EndProperty
  470.       EndProperty
  471.    End
  472.    Begin MSComctlLib.Toolbar SzToolbar 
  473.       Align           =   1  'Align Top
  474.       Height          =   555
  475.       Left            =   0
  476.       TabIndex        =   7
  477.       Top             =   0
  478.       Width           =   11820
  479.       _ExtentX        =   20849
  480.       _ExtentY        =   979
  481.       ButtonWidth     =   820
  482.       ButtonHeight    =   926
  483.       AllowCustomize  =   0   'False
  484.       Appearance      =   1
  485.       Style           =   1
  486.       ImageList       =   "ImageList1"
  487.       _Version        =   393216
  488.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  489.          NumButtons      =   17
  490.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  491.             Caption         =   "设置"
  492.             Key             =   "ymsz"
  493.             ImageKey        =   "sz"
  494.          EndProperty
  495.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  496.             Caption         =   "打印"
  497.             Key             =   "dy"
  498.             ImageKey        =   "dy"
  499.          EndProperty
  500.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  501.             Caption         =   "预览"
  502.             Key             =   "yl"
  503.             ImageKey        =   "yl"
  504.          EndProperty
  505.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Style           =   3
  507.          EndProperty
  508.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  509.             Caption         =   "查询"
  510.             Key             =   "cx"
  511.             ImageKey        =   "cx"
  512.          EndProperty
  513.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  514.             Object.Visible         =   0   'False
  515.             Caption         =   "刷新"
  516.             Key             =   "sx"
  517.             ImageKey        =   "sx"
  518.          EndProperty
  519.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  520.             Style           =   3
  521.          EndProperty
  522.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  523.             Caption         =   "汇总"
  524.             Key             =   "Sum"
  525.             ImageKey        =   "hz"
  526.          EndProperty
  527.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  528.             Enabled         =   0   'False
  529.             Caption         =   "明细"
  530.             Key             =   "List"
  531.             ImageKey        =   "mx"
  532.          EndProperty
  533.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  534.             Style           =   3
  535.          EndProperty
  536.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  537.             Caption         =   "首张"
  538.             Key             =   "first"
  539.             ImageKey        =   "first"
  540.          EndProperty
  541.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  542.             Caption         =   "上张"
  543.             Key             =   "prev"
  544.             ImageKey        =   "prev"
  545.          EndProperty
  546.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  547.             Caption         =   "下张"
  548.             Key             =   "next"
  549.             ImageKey        =   "next"
  550.          EndProperty
  551.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  552.             Caption         =   "末张"
  553.             Key             =   "last"
  554.             ImageKey        =   "last"
  555.          EndProperty
  556.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  557.             Style           =   3
  558.          EndProperty
  559.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  560.             Caption         =   "帮助"
  561.             Key             =   "bz"
  562.             ImageKey        =   "bz"
  563.          EndProperty
  564.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  565.             Caption         =   "退出"
  566.             Key             =   "fh"
  567.             ImageKey        =   "tc"
  568.          EndProperty
  569.       EndProperty
  570.       BorderStyle     =   1
  571.    End
  572. End
  573. Attribute VB_Name = "KF_SumInout"
  574. Attribute VB_GlobalNameSpace = False
  575. Attribute VB_Creatable = False
  576. Attribute VB_PredeclaredId = True
  577. Attribute VB_Exposed = False
  578. '**************************************************************************
  579. '*    模 块 名 称 :收发存汇总
  580. '*    功 能 描 述 :
  581. '*    程序员姓名  :徐强
  582. '*    最后修改人  :张万成
  583. '*    最后修改时间:2001/12/10
  584. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  585. '**************************************************************************
  586. Dim ReportTitle As String                '报表主标题
  587. '以下为固定使用变量
  588. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  589. Dim GridCode As String                   '显示网格网格代码
  590. Dim GridInf() As Variant                 '整个网格设置信息
  591. Dim Tsxx As String                       '系统提示信息
  592. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  593. Dim Sjhgd As Double                      '网格数据行高度
  594. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  595. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  596. Dim GridStr()  As String                 '网格列信息(字符型)
  597. Dim GridInt() As Integer                 '网格列信息(整型)
  598. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  599. Dim Xtyear As Integer, Period As Integer
  600. Dim Rec_WH As New Recordset
  601. Dim Str_Class1 As String
  602. Dim Str_Class2 As String
  603. Dim Str_Mate As String
  604. Dim fixIn, fixOut As Integer
  605. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  606.     On Error Resume Next
  607.     With CxbbGrid
  608.         .Width = Me.Width - 160
  609.         .Height = Me.Height - .Top - 400
  610.     End With
  611.     With Pic_Title
  612.         .Width = Me.Width - 160
  613.     End With
  614.     
  615.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  616. End Sub
  617. Private Sub Form_Load()                                                   '窗体装入
  618.   
  619.     '调入打印页面设置窗体
  620.     ReportTitle = "收发存汇总表"
  621.     XtReportCode = "kf_suminout"
  622.     Load Dyymctbl
  623.       
  624.     '调整标题栏及网格、格式工具条位置(Fixed)
  625.     Pic_Title.Left = 40
  626.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  627.     CxbbGrid.Left = Pic_Title.Left
  628.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  629.      
  630.     '调 入 网 格(Fixed)
  631.     GridCode = "kf_suminout"
  632.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  633.       
  634.     Qslz = GridInf(1)
  635.     Sjhgd = GridInf(2)
  636.     Sfxshjwg = GridInf(7)
  637.     Szzls = CxbbGrid.Cols - 1
  638. End Sub
  639. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  640.     '卸载条件窗体
  641.     KF_SumInoutQuery.UnloadCheck.Value = 1
  642.     Unload KF_SumInoutQuery
  643.     
  644.     '卸载打印页面设置窗体
  645.     Unload Dyymctbl
  646. End Sub
  647. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  648.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  649. End Sub
  650. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  651.   
  652.     Select Case Button.Key
  653.         Case "bcgs"                                          '保存表格格式
  654.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  655.         Case "hfmrgs"                                        '恢复默认格式
  656.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  657.         Case "szxsxm"                                        '设置显示项目
  658.             Call Szxsxm(CxbbGrid, GridCode)
  659.     End Select
  660. End Sub
  661. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  662. Select Case Button.Key
  663.     Case "ymsz"                                          '页面设置
  664.         Dyymctbl.Show 1
  665.     Case "yl"                                            '预 览
  666.         Call bbyl(True)
  667.     Case "dy"                                            '打 印
  668.         Call bbyl(False)
  669.     Case "cx"                                            '查 询
  670.         KF_SumInoutQuery.Show 1
  671.     Case "Sum"                                           '汇总
  672.         Call HuiZong
  673.         SzToolbar.Buttons("Sum").Enabled = False
  674.         SzToolbar.Buttons("List").Enabled = True
  675.     Case "List"                                           '明细
  676.         SzToolbar.Buttons("List").Enabled = False
  677.         SzToolbar.Buttons("Sum").Enabled = True
  678.         If Rec_WH.State = 1 Then
  679.             If Rec_WH.RecordCount <> 0 Then
  680.                 If Rec_WH.EOF Then
  681.                     Rec_WH.MoveLast
  682.                 ElseIf Rec_WH.BOF Then
  683.                     Rec_WH.MoveFirst
  684.                 End If
  685.                 Call Show_Tab(Rec_WH)
  686.             End If
  687.         End If
  688.     Case "first"
  689.         Call First
  690.     Case "last"
  691.         Call Last
  692.     Case "prev"
  693.         Call Prev
  694.     Case "next"
  695.         Call Sub_next
  696.     Case "sx"                                            '刷 新
  697.         If Rec_WH.State = 1 Then
  698.           If Rec_WH.RecordCount <> 0 Then
  699.             If Rec_WH.EOF Then
  700.                 Rec_WH.MoveLast
  701.             ElseIf Rec_WH.BOF Then
  702.                 Rec_WH.MoveFirst
  703.             End If
  704.             Call Sub_Query
  705.           End If
  706.         End If
  707.     Case "bz"                                            '帮 助
  708.         Call F1bz
  709.     Case "fh"                                            '退 出
  710.         Unload Me
  711. End Select
  712. End Sub
  713. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  714.     
  715.     Timer1.Enabled = False
  716.     Xt_Wait.Show
  717.     Xt_Wait.Refresh
  718.    
  719.     '加快显示速度
  720.  
  721.     '生成查询结果
  722.     Call Sub_Query
  723.    
  724.     
  725.     Xt_Wait.Hide
  726. End Sub
  727. Private Sub Sub_Query()                                    '生成查询结果
  728.     Dim Sqlstr As String                        '查询字符串
  729.     Dim Coljsq As Long                          '网格列计数器
  730.     Dim jsqte As Long                        '临时动态计数器
  731.     Dim Str_WH As String
  732.     Dim str_WH1 As String
  733.     Dim Str_QueryCondi As String             '用户录入查询条件
  734.  '以下为用户自定义部分[
  735.      Str_QueryCondi = ""
  736.      With KF_SumInoutQuery
  737.     
  738.          Str_Class1 = "select distinct inoutclassname from kf_v_inoutclass where inoutflag=1"
  739.          Str_Class2 = "select distinct inoutclassname from kf_v_inoutclass where inoutflag=0"
  740.          Str_WH = "select distinct whcode,whname from KF_V_InOutClass   where 1=1 "
  741.          str_WH1 = "select distinct whcode,whname from KF_V_ledger   where 1=1 "
  742.          Str_Mate = ""
  743.          
  744.          For jsqte = 1 To 4
  745.             Select Case jsqte
  746.               
  747.                Case 1  '会计期间
  748.                 If Trim(.Combo_Kjqj2.Text) <> "" Then
  749.                     Xtyear = S2N(Mid(Trim(.Combo_Kjqj2.Text), 1, 4))
  750.                     Period = S2N(Mid(Trim(.Combo_Kjqj2.Text), 6))
  751.                     Str_QueryCondi = Str_QueryCondi & " and kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  752.                 End If
  753.               
  754.               Case 2   '仓库
  755.                  If Trim(.LrText(0).Text) <> "" Then
  756.                     Str_QueryCondi = Str_QueryCondi & " and whcode='" & Trim(.LrText(0).Tag) & "'"
  757.                  End If
  758.              
  759.               Case 3   '物料分类
  760.                 If Trim(.LrText(1).Text) <> "" Then
  761.                     Str_QueryCondi = Str_QueryCondi & " and invsortcode LIKE '" & Trim(.LrText(1).Tag) & "%'"
  762.                     Str_Mate = " and invsortcode LIKE '" & Trim(.LrText(1).Tag) & "%'"
  763.                 End If
  764.                 
  765.               Case 4   '物料编码
  766.                 If Trim(.LrText(2).Tag) <> "" Then
  767.                     Str_QueryCondi = Str_QueryCondi & " and mnumber='" & Trim(.LrText(2).Tag) & "'"
  768.                     Str_Mate = Str_Mate & " and mnumber='" & Trim(.LrText(2).Tag) & "'"
  769.                 End If
  770.             End Select
  771.         Next jsqte
  772.      End With
  773.     Str_WH = Str_WH & Str_QueryCondi
  774.     str_WH1 = str_WH1 & Str_QueryCondi
  775.     Str_Class1 = Str_Class1 & Str_QueryCondi
  776.     Str_Class2 = Str_Class2 & Str_QueryCondi
  777.  
  778.     Set Rec_WH = Cw_DataEnvi.DataConnect.Execute(Str_WH & " union " & str_WH1)
  779.     
  780.     If Not Rec_WH.EOF Then
  781.         Rec_WH.MoveFirst
  782.         Call Show_Tab(Rec_WH)
  783.     Else
  784.         Label3 = "仓库编码: " & KF_SumInoutQuery.LrText(0).Text
  785.         Label1 = "仓库名称: " & KF_SumInoutQuery.LrText(0).Tag
  786.         Label2 = "会计期间: " & Trim(KF_SumInoutQuery.Combo_Kjqj1.Text) & "----" & Trim(KF_SumInoutQuery.Combo_Kjqj2.Text)
  787.         
  788.         CxbbGrid.Clear 1
  789.         CxbbGrid.Rows = CxbbGrid.FixedRows
  790.         
  791.         fixIn = 0
  792.         fixOut = 0
  793.     End If
  794. End Sub
  795. Private Sub FillGrid(str1 As String, str2 As String)
  796.     Dim Rec_Class1 As New Recordset
  797.     Set Rec_Class1 = Cw_DataEnvi.DataConnect.Execute(str1 & " and whcode='" & Trim(Rec_WH.Fields("whcode")) & "'")
  798.     Dim Rec_Class2 As New Recordset
  799.     Set Rec_Class2 = Cw_DataEnvi.DataConnect.Execute(str2 & " and whcode='" & Trim(Rec_WH.Fields("whcode")) & "'")
  800.      
  801.     fixIn = Rec_Class1.RecordCount
  802.     fixOut = Rec_Class2.RecordCount
  803.      With CxbbGrid
  804.         .BackColorFixed = &H8000000F    'Dbl_BackColorFixed                           '固定行背景色 ('&H80000018)
  805.         .Cols = Qslz + 10 + Rec_Class1.RecordCount + Rec_Class2.RecordCount
  806.         .AllowUserResizing = flexResizeBoth
  807.         .SelectionMode = flexSelectionByRow
  808.         .ExplorerBar = flexExNone                                  '网格列是否可移动及排序
  809.         .ScrollTips = True
  810.         .WordWrap = True
  811.         
  812.         For jsq = Qslz To .Cols - 1
  813.             .ColHidden(jsq) = False
  814.         Next jsq
  815.         
  816.         '填 充 网 格 标 题
  817.         For Rowjsq = 0 To .FixedRows - 1
  818.             .MergeRow(Rowjsq) = True
  819.             .RowHeight(Rowjsq) = Sjhgd * 1.8
  820.             .TextMatrix(Rowjsq, Qslz) = "物料编码"
  821.             .TextMatrix(Rowjsq, Qslz + 1) = "物料名称"
  822.             .TextMatrix(Rowjsq, Qslz + 2) = "规格型号"
  823.             .TextMatrix(Rowjsq, Qslz + 3) = "计量单位"
  824.             .TextMatrix(Rowjsq, Qslz + 4) = "期初数量"
  825.             Coljsq = Qslz + 5
  826.             If Not Rec_Class1.EOF Then
  827.                 Rec_Class1.MoveFirst
  828.                 For Coljsq = (Qslz + 5) To (.Cols - 6 - Rec_Class2.RecordCount)
  829.                     .TextMatrix(Rowjsq, Coljsq) = Trim(Rec_Class1.Fields("inoutclassname")) & "数量"
  830.                     .ColWidth(Coljsq) = Sjhgd * 6
  831.                     Rec_Class1.MoveNext
  832.                 Next Coljsq
  833.             End If
  834.             .TextMatrix(Rowjsq, Coljsq) = "无入库类别数量"
  835.             .TextMatrix(Rowjsq, Coljsq + 1) = "合计入库数量"
  836.             If Not Rec_Class2.EOF Then
  837.                 Rec_Class2.MoveFirst
  838.                 For Coljsq = (Qslz + 7 + Rec_Class1.RecordCount) To (.Cols - 4)
  839.                     .TextMatrix(Rowjsq, Coljsq) = Trim(Rec_Class2.Fields("inoutclassname")) & "数量"
  840.                     .ColWidth(Coljsq) = Sjhgd * 6
  841.                     Rec_Class2.MoveNext
  842.                 Next Coljsq
  843.             End If
  844.             .TextMatrix(Rowjsq, (.Cols - 3)) = "无出库类别数量"
  845.             .TextMatrix(Rowjsq, (.Cols - 2)) = "合计出库数量"
  846.             .TextMatrix(Rowjsq, (.Cols - 1)) = "结存数量"
  847.         Next Rowjsq
  848.         
  849.         '数 据 网 格 高 度
  850.         For Rowjsq = .FixedRows To .Rows - 1
  851.             .RowHeight(Rowjsq) = Sjhgd
  852.         Next Rowjsq
  853.         
  854.         '定 义 录 入 字 段 属 性
  855.         For Coljsq = (Qslz + 4) To .Cols - 1
  856.             .MergeCol(Coljsq) = True
  857.             .ColAlignment(Coljsq) = flexAlignRightTop
  858.             .FixedAlignment(Coljsq) = flexAlignGeneral
  859.         Next Coljsq
  860.         For Coljsq = 0 To .Cols - 1
  861.             If .TextMatrix(0, Coljsq) = "合计入库数量" Or .TextMatrix(0, Coljsq) = "合计出库数量" Then
  862.                 .ColWidth(Coljsq) = Sjhgd * 6
  863.             End If
  864.         Next Coljsq
  865.         .ColWidth(.Cols - 1) = Sjhgd * 6
  866.         .ColWidth(.Cols - 3) = Sjhgd * 6
  867.     End With
  868. End Sub
  869. Private Sub Show_Tab(Rec_Temp As Recordset)
  870.     Dim Str_QC As String
  871.     Dim rec_start As New Recordset
  872.     Dim In_Count As Double
  873.     Dim Out_Count As Double
  874.     Dim Str_Bill As String
  875.     Dim str_temp As String
  876.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  877.     
  878.     Call FillGrid(Str_Class1, Str_Class2)
  879.     Label3 = "仓库编码: " & Trim(Rec_Temp.Fields("whcode"))
  880.     Label1 = "仓库名称: " & Trim(Rec_Temp.Fields("whname"))
  881.     Label2 = "会计期间: " & Trim(KF_SumInoutQuery.Combo_Kjqj1.Text) & "----" & Trim(KF_SumInoutQuery.Combo_Kjqj2.Text)
  882.     
  883.     CxbbGrid.Redraw = False
  884.     CxbbGrid.Rows = CxbbGrid.FixedRows
  885.     
  886.         jsqte = CxbbGrid.Rows
  887.             Str_Bill = "select a.*,isnull((SELECT SUM(startquan) FROM KF_V_Ledger WHERE kjyear=" & Xtyear & " and period =" & S2N(Mid(Trim(KF_SumInoutQuery.Combo_Kjqj1.Text), 6)) & " AND mnumber =a.mnumber and whcode='" & Trim(Rec_Temp.Fields("whcode")) & "' group by mnumber),0)as startquan " & _
  888.                         "from (SELECT SUM(factreceiptquan)AS In_count,SUM(factissuequan)AS Out_count,mnumber,inoutclasscode, " & _
  889.                         "(select inoutclassname from gy_inoutclass where inoutclasscode=KF_V_InOutClass.inoutclasscode)as inoutclassname , " & _
  890.                         "(select mname from gy_material where mnumber=KF_V_InOutClass.mnumber)as mname,(select model from gy_material where KF_V_InOutClass.mnumber=gy_material.mnumber) as model, " & _
  891.                         "(select primaryunitname from gy_material where KF_V_InOutClass.mnumber=gy_material.mnumber) as primaryunitname From KF_V_InOutClass " & _
  892.                         "where whcode='" & Trim(Rec_Temp.Fields("whcode")) & "'  and kjyear=" & Xtyear & " and period between " & S2N(Mid(Trim(KF_SumInoutQuery.Combo_Kjqj1.Text), 6)) & " and " & S2N(Mid(Trim(KF_SumInoutQuery.Combo_Kjqj2.Text), 6)) & Str_Mate & "  GROUP BY mnumber, inoutclasscode)a order by mnumber"
  893.             
  894.             Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Str_Bill)
  895.             Dim Sum_In As Double, Sum_Out As Double
  896.             Sum_In = 0
  897.             Sum_Out = 0
  898.             If Not Rec_Query.EOF Then
  899.                 Rec_Query.MoveFirst
  900.                 CxbbGrid.AddItem ""
  901.                 CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(Rec_Query.Fields("mnumber"))        '物料编码
  902.                 CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(Rec_Query.Fields("mname"))      '物料名称
  903.                 CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(Rec_Query.Fields("model"))      '规格型号
  904.                 CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(Rec_Query.Fields("primaryunitname"))    '计量单位
  905.                 CxbbGrid.TextMatrix(jsqte, Qslz + 4) = S2N(Rec_Query.Fields("startquan"))           '期初数量
  906.                 CxbbGrid.RowHeight(jsqte) = Sjhgd
  907.                 Do While Not Rec_Query.EOF
  908.                     If Trim(Rec_Query.Fields("mnumber")) = Trim(CxbbGrid.TextMatrix(jsqte, Qslz)) Then  '将行转换成列
  909.                         If IsNull(Rec_Query.Fields("inoutclassname")) Then
  910.                               If S2N(Rec_Query.Fields("In_count")) <> 0 Then
  911.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 5)) = S2N(Rec_Query.Fields("In_count"))        '入库数量
  912.                                 Sum_In = Sum_In + S2N(Rec_Query.Fields("In_count"))
  913.                             End If
  914.                             
  915.                             If S2N(Rec_Query.Fields("out_count")) <> 0 Then
  916.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - 3)) = S2N(Rec_Query.Fields("Out_count"))                '出库数量
  917.                                 Sum_Out = Sum_Out + S2N(Rec_Query.Fields("Out_count"))
  918.                             End If
  919.                         End If
  920.                             For Coljsq = (Qslz + 5) To CxbbGrid.Cols - 3
  921.                                 If Trim(Rec_Query.Fields("inoutclassname")) & "数量" = Trim(CxbbGrid.TextMatrix(0, Coljsq)) Then
  922.                                     If S2N(Rec_Query.Fields("In_count") & "") <> 0 Then
  923.                                         CxbbGrid.TextMatrix(jsqte, Coljsq) = S2N(Rec_Query.Fields("In_count"))                      '入库数量
  924.                                         Sum_In = Sum_In + S2N(Rec_Query.Fields("In_count"))
  925.                                     Else
  926.                                         CxbbGrid.TextMatrix(jsqte, Coljsq) = S2N(Rec_Query.Fields("Out_count"))                     '出库数量
  927.                                         Sum_Out = Sum_Out + S2N(Rec_Query.Fields("Out_count"))
  928.                                     End If
  929.                                 End If
  930.                             Next
  931.                             CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  932.                             CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  933.                             CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = S2N(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out        '结存数量
  934.                             Rec_Query.MoveNext
  935.                     Else
  936.                         Sum_In = 0
  937.                         Sum_Out = 0
  938.                         jsqte = jsqte + 1
  939.                         CxbbGrid.AddItem ""
  940.                         CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(Rec_Query.Fields("mnumber"))                                '物料编码
  941.                         CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(Rec_Query.Fields("mname"))                              '物料名称
  942.                         CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(Rec_Query.Fields("model"))                              '规格型号
  943.                         CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(Rec_Query.Fields("primaryunitname"))                    '计量单位
  944.                         CxbbGrid.TextMatrix(jsqte, Qslz + 4) = S2N(Rec_Query.Fields("startquan"))                           '期初数量
  945.                         CxbbGrid.RowHeight(jsqte) = Sjhgd
  946.                         If IsNull(Rec_Query.Fields("inoutclassname")) Then
  947.                               If S2N(Rec_Query.Fields("In_count")) <> 0 Then
  948.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 5)) = S2N(Rec_Query.Fields("In_count"))    '入库数量
  949.                                 Sum_In = Sum_In + S2N(Rec_Query.Fields("In_count"))
  950.                             End If
  951.                             
  952.                             If S2N(Rec_Query.Fields("out_count")) <> 0 Then
  953.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - 3)) = S2N(Rec_Query.Fields("Out_count"))            '出库数量
  954.                                 
  955.                                 Sum_Out = Sum_Out + S2N(Rec_Query.Fields("Out_count"))
  956.                             End If
  957.                         End If
  958.                             For Coljsq = (Qslz + 5) To CxbbGrid.Cols - 3
  959.                                 If Trim(Rec_Query.Fields("inoutclassname")) & "数量" = Trim(CxbbGrid.TextMatrix(0, Coljsq)) Then
  960.                                     If S2N(Rec_Query.Fields("In_count")) <> 0 Then
  961.                                         CxbbGrid.TextMatrix(jsqte, Coljsq) = S2N(Rec_Query.Fields("In_count"))                  '入库数量
  962.                                         Sum_In = Sum_In + S2N(Rec_Query.Fields("In_count"))
  963.                                     Else
  964.                                         CxbbGrid.TextMatrix(jsqte, Coljsq) = S2N(Rec_Query.Fields("Out_count"))                 '出库数量
  965.                                         Sum_Out = Sum_Out + S2N(Rec_Query.Fields("Out_count"))
  966.                                     End If
  967.                                 End If
  968.                             Next
  969.                             CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  970.                             CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  971.                             CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = S2N(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out    '结存数量
  972.                             Rec_Query.MoveNext
  973.                     End If
  974.                 Loop
  975.             Else
  976.                 Str_QC = "SELECT SUM(startquan) AS startquan,  mnumber, whname, mname, primaryunitname, model" & _
  977.                     " FROM KF_V_Ledger WHERE kjyear=" & Xtyear & " and period =" & S2N(Mid(Trim(KF_SumInoutQuery.Combo_Kjqj1.Text), 6)) & "  and whcode='" & Trim(Rec_Temp.Fields("whcode")) & "'" & _
  978.                     " GROUP BY  mnumber, whname, mname, primaryunitname, model"
  979.                 
  980.                 Set rec_start = Cw_DataEnvi.DataConnect.Execute(Str_QC)
  981.                 If Not rec_start.EOF Then
  982.                     CxbbGrid.AddItem ""
  983.                     CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(rec_start.Fields("mnumber"))            '物料编码
  984.                     CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(rec_start.Fields("mname"))          '物料名称
  985.                     CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(rec_start.Fields("model"))          '规格型号
  986.                     CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(rec_start.Fields("primaryunitname"))    '计量单位
  987.                     CxbbGrid.TextMatrix(jsqte, Qslz + 4) = 0
  988.                     CxbbGrid.TextMatrix(jsqte, Qslz + 4) = Trim(rec_start.Fields("startquan"))      '期初数量
  989.                     CxbbGrid.RowHeight(jsqte) = Sjhgd
  990.                     CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  991.                     CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  992.                     CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = S2N(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out    '结存数量
  993.                     jsqte = jsqte + 1
  994.                 End If
  995.             End If
  996.     Call SLGSH
  997.     If Not SzToolbar.Buttons("Sum").Enabled Then
  998.         Call HuiZong
  999.     End If
  1000.     CxbbGrid.Redraw = True
  1001. End Sub
  1002. Private Sub SLGSH()         '数据格式化
  1003.     With CxbbGrid
  1004.         For hjsq = .FixedRows To .Rows - 1
  1005.             For ljsq = Qslz + 4 To .Cols - 1
  1006.                 .TextMatrix(hjsq, ljsq) = Format(Trim(.TextMatrix(hjsq, ljsq)), "#,##0." + String(Xtslxsws, "0"))
  1007.                 
  1008.                 If S2N(.TextMatrix(hjsq, ljsq)) = 0 Then
  1009.                     .TextMatrix(hjsq, ljsq) = ""
  1010.                 End If
  1011.             Next ljsq
  1012.         Next hjsq
  1013.     End With
  1014. End Sub
  1015. Private Sub HuiZong()       '汇总数据
  1016.     With CxbbGrid
  1017.         If fixIn > 0 Then
  1018.             For jsq = (Qslz + 5) To (Qslz + 5 + fixIn)
  1019.                 .ColHidden(jsq) = True
  1020.             Next
  1021.         End If
  1022.         If fixOut > 0 Then
  1023.             For jsq = (Qslz + 7 + fixIn) To (.Cols - 3)
  1024.                 .ColHidden(jsq) = True
  1025.             Next
  1026.         End If
  1027.     
  1028.     End With
  1029. End Sub
  1030. Private Sub First()
  1031.     If Rec_WH.State = 1 Then
  1032.         If Rec_WH.RecordCount > 0 Then
  1033.             Rec_WH.MoveFirst
  1034.             Call Show_Tab(Rec_WH)
  1035.         End If
  1036.     End If
  1037. End Sub
  1038. Private Sub Last()
  1039.     If Rec_WH.State = 1 Then
  1040.         If Rec_WH.RecordCount > 0 Then
  1041.             Rec_WH.MoveLast
  1042.             Call Show_Tab(Rec_WH)
  1043.         End If
  1044.     End If
  1045. End Sub
  1046. Private Sub Prev()
  1047.     If Rec_WH.State = 1 Then
  1048.         If Rec_WH.RecordCount > 0 Then
  1049.             If Rec_WH.EOF Then
  1050.                 Rec_WH.MovePrevious
  1051.             End If
  1052.             If Not Rec_WH.BOF Then
  1053.                 Rec_WH.MovePrevious
  1054.                 If Not Rec_WH.BOF Then
  1055.                     Call Show_Tab(Rec_WH)
  1056.                 End If
  1057.             End If
  1058.         End If
  1059.     End If
  1060. End Sub
  1061. Private Sub Sub_next()
  1062.     If Rec_WH.State = 1 Then
  1063.         If Rec_WH.RecordCount > 0 Then
  1064.             If Rec_WH.BOF Then
  1065.                 Rec_WH.MoveNext
  1066.             End If
  1067.             If Not Rec_WH.EOF Then
  1068.                 Rec_WH.MoveNext
  1069.                 If Not Rec_WH.EOF Then
  1070.                     Call Show_Tab(Rec_WH)
  1071.                 End If
  1072.             End If
  1073.         End If
  1074.     End If
  1075. End Sub
  1076. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1077.     
  1078.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1079.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1080.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1081.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1082.     ReDim Bbxbt(1 To Bbxbtgs)
  1083.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1084.     If Bbbwhgs <> 0 Then
  1085.         ReDim Bbbwh(1 To Bbbwhgs)
  1086.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1087.     End If
  1088.     Bbzbt = ReportTitle
  1089.     Bbxbt(1) = ""
  1090.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1091.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1092.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1093.     If Not bbylte Then
  1094.         Unload DY_Tybbyldy
  1095.     End If
  1096. End Sub