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

企业管理

开发平台:

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_FrmStockAcc 
  5.    Caption         =   "帐簿分析_库存台帐"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   8880
  10.    HelpContextID   =   1217002
  11.    Icon            =   "帐簿分析_库存台帐查询结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   8880
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.Toolbar GsToolbar 
  19.       Height          =   540
  20.       Left            =   9330
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   2475
  24.       _ExtentX        =   4366
  25.       _ExtentY        =   953
  26.       ButtonWidth     =   1455
  27.       ButtonHeight    =   953
  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          =   1395
  54.       Left            =   0
  55.       Picture         =   "帐簿分析_库存台帐查询结果.frx":1042
  56.       ScaleHeight     =   1335
  57.       ScaleWidth      =   11715
  58.       TabIndex        =   1
  59.       Top             =   570
  60.       Width           =   11775
  61.       Begin VB.CommandButton Cmd_CancelPrint 
  62.          Caption         =   "取消打印(&C)"
  63.          Height          =   405
  64.          Left            =   7620
  65.          TabIndex        =   10
  66.          Top             =   150
  67.          Visible         =   0   'False
  68.          Width           =   1155
  69.       End
  70.       Begin VB.Label Label1 
  71.          AutoSize        =   -1  'True
  72.          BackStyle       =   0  'Transparent
  73.          Caption         =   "物料分类:"
  74.          Height          =   180
  75.          Left            =   4650
  76.          TabIndex        =   9
  77.          Top             =   750
  78.          Width           =   810
  79.       End
  80.       Begin VB.Label Label2 
  81.          AutoSize        =   -1  'True
  82.          BackStyle       =   0  'Transparent
  83.          Caption         =   "物料编码:"
  84.          Height          =   195
  85.          Left            =   1410
  86.          TabIndex        =   8
  87.          Top             =   750
  88.          Width           =   765
  89.       End
  90.       Begin VB.Label Label3 
  91.          AutoSize        =   -1  'True
  92.          BackStyle       =   0  'Transparent
  93.          Caption         =   "物料名称:"
  94.          Height          =   195
  95.          Left            =   1410
  96.          TabIndex        =   7
  97.          Top             =   1050
  98.          Width           =   765
  99.       End
  100.       Begin VB.Label Label4 
  101.          AutoSize        =   -1  'True
  102.          BackStyle       =   0  'Transparent
  103.          Caption         =   "规格型号:"
  104.          Height          =   195
  105.          Left            =   4650
  106.          TabIndex        =   6
  107.          Top             =   1050
  108.          Width           =   765
  109.       End
  110.       Begin VB.Label Label5 
  111.          AutoSize        =   -1  'True
  112.          BackStyle       =   0  'Transparent
  113.          Caption         =   "计量单位:"
  114.          Height          =   195
  115.          Left            =   7050
  116.          TabIndex        =   5
  117.          Top             =   1050
  118.          Width           =   765
  119.       End
  120.       Begin VB.Label Lab_Title 
  121.          BackColor       =   &H80000018&
  122.          BackStyle       =   0  'Transparent
  123.          Caption         =   "库存台帐"
  124.          BeginProperty Font 
  125.             Name            =   "宋体"
  126.             Size            =   12
  127.             Charset         =   134
  128.             Weight          =   700
  129.             Underline       =   0   'False
  130.             Italic          =   0   'False
  131.             Strikethrough   =   0   'False
  132.          EndProperty
  133.          ForeColor       =   &H00000000&
  134.          Height          =   300
  135.          Index           =   4
  136.          Left            =   480
  137.          TabIndex        =   2
  138.          Top             =   210
  139.          Width           =   2715
  140.       End
  141.    End
  142.    Begin VB.Timer Timer1 
  143.       Enabled         =   0   'False
  144.       Interval        =   1
  145.       Left            =   7620
  146.       Top             =   90
  147.    End
  148.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  149.       Height          =   7995
  150.       Left            =   0
  151.       TabIndex        =   0
  152.       Top             =   1980
  153.       Width           =   11775
  154.       _cx             =   5080
  155.       _cy             =   5080
  156.       Appearance      =   1
  157.       BorderStyle     =   1
  158.       Enabled         =   -1  'True
  159.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  160.          Name            =   "宋体"
  161.          Size            =   9
  162.          Charset         =   134
  163.          Weight          =   400
  164.          Underline       =   0   'False
  165.          Italic          =   0   'False
  166.          Strikethrough   =   0   'False
  167.       EndProperty
  168.       MousePointer    =   0
  169.       BackColor       =   16777215
  170.       ForeColor       =   -2147483640
  171.       BackColorFixed  =   13826538
  172.       ForeColorFixed  =   -2147483630
  173.       BackColorSel    =   -2147483635
  174.       ForeColorSel    =   -2147483634
  175.       BackColorBkg    =   -2147483636
  176.       BackColorAlternate=   16777215
  177.       GridColor       =   -2147483633
  178.       GridColorFixed  =   -2147483632
  179.       TreeColor       =   -2147483632
  180.       FloodColor      =   192
  181.       SheetBorder     =   -2147483642
  182.       FocusRect       =   1
  183.       HighLight       =   1
  184.       AllowSelection  =   -1  'True
  185.       AllowBigSelection=   -1  'True
  186.       AllowUserResizing=   0
  187.       SelectionMode   =   0
  188.       GridLines       =   1
  189.       GridLinesFixed  =   2
  190.       GridLineWidth   =   1
  191.       Rows            =   50
  192.       Cols            =   10
  193.       FixedRows       =   1
  194.       FixedCols       =   1
  195.       RowHeightMin    =   0
  196.       RowHeightMax    =   0
  197.       ColWidthMin     =   0
  198.       ColWidthMax     =   0
  199.       ExtendLastCol   =   0   'False
  200.       FormatString    =   ""
  201.       ScrollTrack     =   0   'False
  202.       ScrollBars      =   3
  203.       ScrollTips      =   0   'False
  204.       MergeCells      =   0
  205.       MergeCompare    =   0
  206.       AutoResize      =   -1  'True
  207.       AutoSizeMode    =   0
  208.       AutoSearch      =   0
  209.       AutoSearchDelay =   2
  210.       MultiTotals     =   -1  'True
  211.       SubtotalPosition=   0
  212.       OutlineBar      =   0
  213.       OutlineCol      =   0
  214.       Ellipsis        =   0
  215.       ExplorerBar     =   0
  216.       PicturesOver    =   0   'False
  217.       FillStyle       =   0
  218.       RightToLeft     =   0   'False
  219.       PictureType     =   0
  220.       TabBehavior     =   0
  221.       OwnerDraw       =   0
  222.       Editable        =   0
  223.       ShowComboButton =   1
  224.       WordWrap        =   0   'False
  225.       TextStyle       =   0
  226.       TextStyleFixed  =   0
  227.       OleDragMode     =   0
  228.       OleDropMode     =   0
  229.       DataMode        =   0
  230.       VirtualData     =   -1  'True
  231.       DataMember      =   ""
  232.       ComboSearch     =   3
  233.       AutoSizeMouse   =   -1  'True
  234.       FrozenRows      =   0
  235.       FrozenCols      =   0
  236.       AllowUserFreezing=   0
  237.       BackColorFrozen =   0
  238.       ForeColorFrozen =   0
  239.       WallPaperAlignment=   9
  240.       AccessibleName  =   ""
  241.       AccessibleDescription=   ""
  242.       AccessibleValue =   ""
  243.       AccessibleRole  =   24
  244.       Begin MSComctlLib.ImageList ImageList2 
  245.          Left            =   0
  246.          Top             =   0
  247.          _ExtentX        =   1005
  248.          _ExtentY        =   1005
  249.          BackColor       =   -2147483643
  250.          ImageWidth      =   16
  251.          ImageHeight     =   16
  252.          MaskColor       =   12632256
  253.          _Version        =   393216
  254.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  255.             NumListImages   =   41
  256.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  257.                Picture         =   "帐簿分析_库存台帐查询结果.frx":1FAC4
  258.                Key             =   "sz"
  259.             EndProperty
  260.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  261.                Picture         =   "帐簿分析_库存台帐查询结果.frx":1FE5E
  262.                Key             =   "dy"
  263.             EndProperty
  264.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  265.                Picture         =   "帐簿分析_库存台帐查询结果.frx":201F8
  266.                Key             =   "yl"
  267.             EndProperty
  268.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  269.                Picture         =   "帐簿分析_库存台帐查询结果.frx":20592
  270.                Key             =   "xg"
  271.             EndProperty
  272.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  273.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2092C
  274.                Key             =   "zh"
  275.             EndProperty
  276.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  277.                Picture         =   "帐簿分析_库存台帐查询结果.frx":20CC6
  278.                Key             =   "sh"
  279.             EndProperty
  280.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  281.                Picture         =   "帐簿分析_库存台帐查询结果.frx":21060
  282.                Key             =   "bc"
  283.             EndProperty
  284.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.                Picture         =   "帐簿分析_库存台帐查询结果.frx":213FA
  286.                Key             =   "fq"
  287.             EndProperty
  288.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.                Picture         =   "帐簿分析_库存台帐查询结果.frx":21794
  290.                Key             =   "bz"
  291.             EndProperty
  292.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.                Picture         =   "帐簿分析_库存台帐查询结果.frx":21B2E
  294.                Key             =   "tc"
  295.             EndProperty
  296.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.                Picture         =   "帐簿分析_库存台帐查询结果.frx":21EC8
  298.                Key             =   "bcgs"
  299.             EndProperty
  300.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.                Picture         =   "帐簿分析_库存台帐查询结果.frx":22262
  302.                Key             =   "mrlk"
  303.             EndProperty
  304.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "帐簿分析_库存台帐查询结果.frx":225FC
  306.                Key             =   "xsxm"
  307.             EndProperty
  308.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "帐簿分析_库存台帐查询结果.frx":22996
  310.                Key             =   "first"
  311.             EndProperty
  312.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "帐簿分析_库存台帐查询结果.frx":22D30
  314.                Key             =   "prev"
  315.             EndProperty
  316.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "帐簿分析_库存台帐查询结果.frx":230CA
  318.                Key             =   "next"
  319.             EndProperty
  320.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "帐簿分析_库存台帐查询结果.frx":23464
  322.                Key             =   "last"
  323.             EndProperty
  324.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "帐簿分析_库存台帐查询结果.frx":237FE
  326.                Key             =   "xx"
  327.             EndProperty
  328.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "帐簿分析_库存台帐查询结果.frx":23B98
  330.                Key             =   "define"
  331.             EndProperty
  332.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "帐簿分析_库存台帐查询结果.frx":23F32
  334.                Key             =   "exec"
  335.             EndProperty
  336.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "帐簿分析_库存台帐查询结果.frx":242CC
  338.                Key             =   "xz"
  339.             EndProperty
  340.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "帐簿分析_库存台帐查询结果.frx":24666
  342.                Key             =   "sc"
  343.             EndProperty
  344.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "帐簿分析_库存台帐查询结果.frx":24A00
  346.                Key             =   "sx"
  347.             EndProperty
  348.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "帐簿分析_库存台帐查询结果.frx":24D9A
  350.                Key             =   "cx"
  351.             EndProperty
  352.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "帐簿分析_库存台帐查询结果.frx":25134
  354.                Key             =   "zd"
  355.             EndProperty
  356.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "帐簿分析_库存台帐查询结果.frx":254CE
  358.                Key             =   "dz"
  359.             EndProperty
  360.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "帐簿分析_库存台帐查询结果.frx":25868
  362.                Key             =   "ph"
  363.             EndProperty
  364.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "帐簿分析_库存台帐查询结果.frx":25C02
  366.                Key             =   "fz"
  367.             EndProperty
  368.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "帐簿分析_库存台帐查询结果.frx":25F9C
  370.                Key             =   "dw"
  371.             EndProperty
  372.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "帐簿分析_库存台帐查询结果.frx":26336
  374.                Key             =   "hf"
  375.             EndProperty
  376.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "帐簿分析_库存台帐查询结果.frx":266D0
  378.                Key             =   "pz"
  379.             EndProperty
  380.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "帐簿分析_库存台帐查询结果.frx":26A6A
  382.                Key             =   "check"
  383.             EndProperty
  384.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "帐簿分析_库存台帐查询结果.frx":26E04
  386.                Key             =   "qs"
  387.             EndProperty
  388.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2719E
  390.                Key             =   "fullcheck"
  391.             EndProperty
  392.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "帐簿分析_库存台帐查询结果.frx":27538
  394.                Key             =   "qq"
  395.             EndProperty
  396.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "帐簿分析_库存台帐查询结果.frx":278D2
  398.                Key             =   "bcw"
  399.             EndProperty
  400.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "帐簿分析_库存台帐查询结果.frx":27C6C
  402.                Key             =   "ye"
  403.             EndProperty
  404.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.                Picture         =   "帐簿分析_库存台帐查询结果.frx":28006
  406.                Key             =   ""
  407.             EndProperty
  408.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.                Picture         =   "帐簿分析_库存台帐查询结果.frx":283A0
  410.                Key             =   "frist"
  411.             EndProperty
  412.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2873A
  414.                Key             =   "dj"
  415.             EndProperty
  416.             BeginProperty ListImage41 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.                Picture         =   "帐簿分析_库存台帐查询结果.frx":28AD4
  418.                Key             =   "ld"
  419.                Object.Tag             =   "连打"
  420.             EndProperty
  421.          EndProperty
  422.       End
  423.    End
  424.    Begin MSComctlLib.Toolbar SzToolbar 
  425.       Align           =   1  'Align Top
  426.       Height          =   555
  427.       Left            =   0
  428.       TabIndex        =   4
  429.       Top             =   0
  430.       Width           =   8880
  431.       _ExtentX        =   15663
  432.       _ExtentY        =   979
  433.       ButtonWidth     =   820
  434.       ButtonHeight    =   926
  435.       AllowCustomize  =   0   'False
  436.       Appearance      =   1
  437.       Style           =   1
  438.       ImageList       =   "ImageList1"
  439.       _Version        =   393216
  440.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  441.          NumButtons      =   17
  442.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  443.             Caption         =   "设置"
  444.             Key             =   "ymsz"
  445.             ImageKey        =   "sz"
  446.          EndProperty
  447.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  448.             Caption         =   "打印"
  449.             Key             =   "dy"
  450.             ImageKey        =   "dy"
  451.          EndProperty
  452.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  453.             Caption         =   "预览"
  454.             Key             =   "yl"
  455.             ImageKey        =   "yl"
  456.          EndProperty
  457.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  458.             Caption         =   "连打"
  459.             Key             =   "ld"
  460.             ImageKey        =   "ld"
  461.          EndProperty
  462.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  463.             Style           =   3
  464.          EndProperty
  465.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  466.             Caption         =   "查询"
  467.             Key             =   "cx"
  468.             ImageKey        =   "cx"
  469.          EndProperty
  470.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  471.             Caption         =   "单据"
  472.             Key             =   "Bill"
  473.             ImageKey        =   "pz"
  474.          EndProperty
  475.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  476.             Style           =   3
  477.          EndProperty
  478.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  479.             Caption         =   "摘要"
  480.             Key             =   "zy"
  481.             ImageKey        =   "define"
  482.          EndProperty
  483.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  484.             Style           =   3
  485.          EndProperty
  486.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  487.             Caption         =   "首张"
  488.             Key             =   "first"
  489.             ImageKey        =   "first"
  490.          EndProperty
  491.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  492.             Caption         =   "上张"
  493.             Key             =   "prev"
  494.             ImageKey        =   "prev"
  495.          EndProperty
  496.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  497.             Caption         =   "下张"
  498.             Key             =   "next"
  499.             ImageKey        =   "next"
  500.          EndProperty
  501.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  502.             Caption         =   "末张"
  503.             Key             =   "last"
  504.             ImageKey        =   "last"
  505.          EndProperty
  506.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  507.             Style           =   3
  508.          EndProperty
  509.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  510.             Caption         =   "帮助"
  511.             Key             =   "bz"
  512.             ImageKey        =   "bz"
  513.          EndProperty
  514.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  515.             Caption         =   "退出"
  516.             Key             =   "fh"
  517.             ImageKey        =   "tc"
  518.          EndProperty
  519.       EndProperty
  520.       BorderStyle     =   1
  521.       Begin MSComctlLib.ImageList ImageList1 
  522.          Left            =   6990
  523.          Top             =   30
  524.          _ExtentX        =   1005
  525.          _ExtentY        =   1005
  526.          BackColor       =   -2147483643
  527.          ImageWidth      =   16
  528.          ImageHeight     =   16
  529.          MaskColor       =   12632256
  530.          _Version        =   393216
  531.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  532.             NumListImages   =   33
  533.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  534.                Picture         =   "帐簿分析_库存台帐查询结果.frx":28E6E
  535.                Key             =   "sz"
  536.             EndProperty
  537.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  538.                Picture         =   "帐簿分析_库存台帐查询结果.frx":29208
  539.                Key             =   "dy"
  540.             EndProperty
  541.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  542.                Picture         =   "帐簿分析_库存台帐查询结果.frx":295A2
  543.                Key             =   "yl"
  544.             EndProperty
  545.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  546.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2993C
  547.                Key             =   "xg"
  548.             EndProperty
  549.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  550.                Picture         =   "帐簿分析_库存台帐查询结果.frx":29CD6
  551.                Key             =   "zh"
  552.             EndProperty
  553.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  554.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2A070
  555.                Key             =   "sh"
  556.             EndProperty
  557.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  558.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2A40A
  559.                Key             =   "bc"
  560.             EndProperty
  561.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  562.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2A7A4
  563.                Key             =   "fq"
  564.             EndProperty
  565.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  566.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2AB3E
  567.                Key             =   "bz"
  568.             EndProperty
  569.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  570.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2AED8
  571.                Key             =   "tc"
  572.             EndProperty
  573.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  574.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2B272
  575.                Key             =   "bcgs"
  576.             EndProperty
  577.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  578.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2B60C
  579.                Key             =   "mrlk"
  580.             EndProperty
  581.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  582.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2B9A6
  583.                Key             =   "xsxm"
  584.             EndProperty
  585.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  586.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2BD40
  587.                Key             =   "first"
  588.             EndProperty
  589.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  590.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2C0DA
  591.                Key             =   "prev"
  592.             EndProperty
  593.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  594.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2C474
  595.                Key             =   "next"
  596.             EndProperty
  597.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  598.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2C80E
  599.                Key             =   "last"
  600.             EndProperty
  601.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  602.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2CBA8
  603.                Key             =   "xx"
  604.             EndProperty
  605.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  606.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2CF42
  607.                Key             =   "define"
  608.             EndProperty
  609.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  610.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2D2DC
  611.                Key             =   "exec"
  612.             EndProperty
  613.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  614.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2D676
  615.                Key             =   "xz"
  616.             EndProperty
  617.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  618.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2DA10
  619.                Key             =   "sc"
  620.             EndProperty
  621.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  622.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2DDAA
  623.                Key             =   "sx"
  624.             EndProperty
  625.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  626.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2E144
  627.                Key             =   "cx"
  628.             EndProperty
  629.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  630.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2E4DE
  631.                Key             =   "zd"
  632.             EndProperty
  633.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  634.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2E878
  635.                Key             =   "dz"
  636.             EndProperty
  637.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  638.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2EC12
  639.                Key             =   "ph"
  640.             EndProperty
  641.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  642.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2EFAC
  643.                Key             =   "fz"
  644.             EndProperty
  645.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  646.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2F346
  647.                Key             =   "dw"
  648.             EndProperty
  649.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  650.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2F6E0
  651.                Key             =   "hf"
  652.             EndProperty
  653.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  654.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2FA7A
  655.                Key             =   "pz"
  656.             EndProperty
  657.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  658.                Picture         =   "帐簿分析_库存台帐查询结果.frx":2FE14
  659.                Key             =   "check"
  660.             EndProperty
  661.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  662.                Picture         =   "帐簿分析_库存台帐查询结果.frx":301AE
  663.                Key             =   "ld"
  664.                Object.Tag             =   "ld"
  665.             EndProperty
  666.          EndProperty
  667.       End
  668.    End
  669. End
  670. Attribute VB_Name = "KF_FrmStockAcc"
  671. Attribute VB_GlobalNameSpace = False
  672. Attribute VB_Creatable = False
  673. Attribute VB_PredeclaredId = True
  674. Attribute VB_Exposed = False
  675. '**************************************************************************
  676. '*    模 块 名 称 :库存台帐
  677. '*    功 能 描 述 :
  678. '*    程序员姓名  :张万成
  679. '*    最后修改人  :张万成
  680. '*    最后修改时间:2001/12/06
  681. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  682. '**************************************************************************
  683. Dim ReportTitle As String                '报表主标题
  684. Dim Str_QueryCondi As String             '用户录入查询条件
  685. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  686. Dim Bln_CancelPrint As Boolean           '用户是否取消打印
  687. Dim Bln_Printing As Boolean              '用户是否正在打印
  688. '以下为固定使用变量
  689. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  690. Dim GridCode As String                   '显示网格网格代码
  691. Dim GridInf() As Variant                 '整个网格设置信息
  692. Dim Tsxx As String                       '系统提示信息
  693. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  694. Dim Sjhgd As Double                      '网格数据行高度
  695. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  696. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  697. Dim GridStr()  As String                 '网格列信息(字符型)
  698. Dim GridInt() As Integer                 '网格列信息(整型)
  699. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  700. Dim adoMate As New ADODB.Recordset
  701. Dim adoQuery As New ADODB.Recordset
  702. Public Bln As Boolean
  703. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  704.     On Error Resume Next
  705.     With CxbbGrid
  706.         .Width = Me.Width - 160
  707.         .Height = Me.Height - .Top - 400
  708.     End With
  709.     With Pic_Title
  710.         .Width = Me.Width - 160
  711.     End With
  712.     
  713.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  714. End Sub
  715. Private Sub Form_Load()                                                   '窗体装入
  716.   
  717.     '调入打印页面设置窗体
  718.     ReportTitle = "库存台帐"
  719.     XtReportCode = "KF_StockAcc"
  720.     Load Dyymctbl
  721.       
  722.     '调整标题栏及网格、格式工具条位置(Fixed)
  723.     Pic_Title.Left = 40
  724.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  725.     CxbbGrid.Left = Pic_Title.Left
  726.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  727.      
  728.     '调 入 网 格(Fixed)
  729.     GridCode = "KF_StockAcc"
  730.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  731.       
  732.     Qslz = GridInf(1)
  733.     Sjhgd = GridInf(2)
  734.     Sfxshjwg = GridInf(7)
  735.     Szzls = CxbbGrid.Cols - 1
  736.     
  737.     
  738. End Sub
  739. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  740.     If Bln_Printing Then
  741.         Cancel = 1
  742.     End If
  743.         
  744.     '卸载条件窗体
  745.     KF_FrmStockAccCxtj.UnloadCheck.Value = 1
  746.     Unload KF_FrmStockAccCxtj
  747.     Unload KF_FrmDigest
  748.     '卸载打印页面设置窗体
  749.     Unload Dyymctbl
  750. End Sub
  751. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  752.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  753. End Sub
  754. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  755.   
  756.     Select Case Button.Key
  757.         Case "bcgs"                                          '保存表格格式
  758.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  759.         Case "hfmrgs"                                        '恢复默认格式
  760.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  761.         Case "szxsxm"                                        '设置显示项目
  762.             Call Szxsxm(CxbbGrid, GridCode)
  763.     End Select
  764. End Sub
  765. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  766.     
  767.     If Bln_Printing Then
  768.         Exit Sub
  769.     End If
  770.     
  771.     Select Case Button.Key
  772.         Case "ymsz"                                          '页面设置
  773.             Dyymctbl.Show 1
  774.         Case "yl"                                            '预 览
  775.             Call bbyl(True)
  776.         Case "dy"                                            '打 印
  777.             Call bbyl(False)
  778.         Case "ld"
  779.             Call Sub_Lxdy
  780.         Case "cx"                                            '查 询
  781.             KF_FrmStockAccCxtj.Show 1
  782.         Case "Bill"
  783.             Call CxbbGrid_DblClick
  784.         Case "zy"
  785.             If adoMate.State = 1 Then
  786.                 If adoMate.RecordCount > 0 Then
  787.                     KF_FrmDigest.Label1.Caption = "1"
  788.                     KF_FrmDigest.Show 1
  789.                     If Not Bln Then
  790.                         '[[
  791.                         If adoMate.EOF Then
  792.                             adoMate.MoveLast
  793.                         ElseIf adoMate.BOF Then
  794.                             adoMate.MoveFirst
  795.                         End If
  796.                         Call Show_Tab(adoMate)
  797.                         ']]
  798.                     End If
  799.                 End If
  800.             End If
  801.         Case "first"
  802.             Call First
  803.         Case "last"
  804.             Call Last
  805.         Case "prev"
  806.             Call Prev
  807.         Case "next"
  808.             Call Sub_next
  809.         Case "bz"                                            '帮 助
  810.             Call F1bz
  811.         Case "fh"                                            '退 出
  812.            Unload Me
  813.     End Select
  814. End Sub
  815. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  816.     
  817.     Timer1.Enabled = False
  818.     Xt_Wait.Show
  819.     Xt_Wait.Refresh
  820.    
  821.     '加快显示速度
  822.     CxbbGrid.Redraw = False
  823.  
  824.     '生成查询结果
  825.     Call Sub_Query(0)
  826.    
  827.     CxbbGrid.Redraw = True
  828.     
  829.     Xt_Wait.Hide
  830. End Sub
  831. Private Sub First()
  832.     If adoMate.State = 1 Then
  833.         If adoMate.RecordCount > 0 Then
  834.             adoMate.MoveFirst
  835.             intNowRec = 1
  836.             SzToolbar.Buttons("first").Enabled = False
  837.             SzToolbar.Buttons("prev").Enabled = False
  838.             SzToolbar.Buttons("next").Enabled = True
  839.             SzToolbar.Buttons("last").Enabled = True
  840.             Call Show_Tab(adoMate)
  841.         End If
  842.     End If
  843. End Sub
  844. Private Sub Last()
  845.     If adoMate.State = 1 Then
  846.         If adoMate.RecordCount > 0 Then
  847.             adoMate.MoveLast
  848.             intNowRec = conRecNum
  849.             SzToolbar.Buttons("next").Enabled = False
  850.             SzToolbar.Buttons("last").Enabled = False
  851.             SzToolbar.Buttons("first").Enabled = True
  852.             SzToolbar.Buttons("prev").Enabled = True
  853.             Call Show_Tab(adoMate)
  854.         End If
  855.     End If
  856. End Sub
  857. Private Sub Prev()
  858.     If adoMate.State = 1 Then
  859.         SzToolbar.Buttons("next").Enabled = True
  860.         SzToolbar.Buttons("last").Enabled = True
  861.         If adoMate.RecordCount > 0 Then
  862.             intNowRec = intNowRec - 1
  863.             If adoMate.EOF Then
  864.                 adoMate.MovePrevious
  865.             End If
  866.             If Not adoMate.BOF Then
  867.                 adoMate.MovePrevious
  868.                 If Not adoMate.BOF Then
  869.                     Call Show_Tab(adoMate)
  870.                 End If
  871.             End If
  872.             If adoMate.BOF Then
  873.                 SzToolbar.Buttons("first").Enabled = False
  874.                 SzToolbar.Buttons("prev").Enabled = False
  875.             End If
  876.             
  877.         End If
  878.     End If
  879. End Sub
  880. Private Sub Sub_next()
  881.     If adoMate.State = 1 Then
  882.         If adoMate.RecordCount > 0 Then
  883.             SzToolbar.Buttons("first").Enabled = True
  884.             SzToolbar.Buttons("prev").Enabled = True
  885.             intNowRec = intNowRec + 1
  886.             If adoMate.BOF Then
  887.                 adoMate.MoveNext
  888.             End If
  889.             If Not adoMate.EOF Then
  890.                 adoMate.MoveNext
  891.                 If Not adoMate.EOF Then
  892.                     Call Show_Tab(adoMate)
  893.                 End If
  894.             End If
  895.             If adoMate.EOF Then
  896.                 SzToolbar.Buttons("next").Enabled = False
  897.                 SzToolbar.Buttons("last").Enabled = False
  898.             End If
  899.         End If
  900.     End If
  901. End Sub
  902. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  903.     
  904.    Dim Sqlstr1 As String                        '查询字符串
  905.    Dim Sqlstr2 As String
  906.    Dim Sqlstr As String
  907.    Dim Coljsq As Long                          '网格列计数器
  908.    Dim jsqte As Long                        '临时动态计数器
  909.    Dim Xtyear As Integer
  910.    Dim Period As Integer
  911.    Dim adoPeriod As New ADODB.Recordset
  912.    
  913.  '以下为用户自定义部分[
  914.  With KF_FrmStockAccCxtj
  915.      
  916.      '显示查询会计期间
  917.      Sqlstr1 = "select mnumber,(select mname from gy_material where kf_v_ledger.mnumber=gy_material.mnumber) as mname, " & _
  918.                " (select model from gy_material where kf_v_ledger.mnumber=gy_material.mnumber) as model, " & _
  919.                " (select primaryunitname from gy_material where kf_v_ledger.mnumber=gy_material.mnumber) as primaryunitname, " & _
  920.                " (select invsortname from KF_V_InvSort where kf_v_ledger.mnumber=KF_V_InvSort.mnumber) as invsortname" & _
  921.                " from kf_V_ledger where 1=1 "
  922.      Sqlstr2 = "select  mnumber, (select mname from gy_material where kf_v_inout.mnumber=gy_material.mnumber) as mname, " & _
  923.                " (select model from gy_material where kf_v_inout.mnumber=gy_material.mnumber) as model, " & _
  924.                " (select primaryunitname from gy_material where kf_v_inout.mnumber=gy_material.mnumber) as primaryunitname,  " & _
  925.                " (select invsortname from KF_V_InvSort where kf_v_inout.mnumber=KF_V_InvSort.mnumber) as invsortname" & _
  926.                " from kf_v_inout where billcode<>'1212' "
  927.      
  928.      Xtyear = S2N(Mid(Trim(.Combo_Kjqj2.Text), 1, 4))
  929.      Period = S2N(Mid(Trim(.Combo_Kjqj2.Text), 6))
  930.      Str_QueryCondi = ""
  931.      Set adoPeriod = Cw_DataEnvi.DataConnect.Execute("select period from gy_kjrlb where beginflag=1 and kjyear=" & Xtyear)
  932.      
  933.      For jsqte = 1 To 5
  934.         Select Case jsqte
  935.           
  936.            Case 1  '会计期间
  937.             If Trim(.Combo_Kjqj2.Text) <> "" Then
  938.                 If Not adoPeriod.EOF Then
  939.                     If S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) < S2N(adoPeriod.Fields("period")) Then
  940.                         Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & S2N(adoPeriod.Fields("period")) & " and " & Period
  941.                         Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & S2N(adoPeriod.Fields("period")) & " and " & Period
  942.                         Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & S2N(adoPeriod.Fields("period")) & " and " & Period
  943.                     Else
  944.                         Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  945.                         Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  946.                         Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  947.                     End If
  948.                 Else
  949.                     Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  950.                     Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  951.                     Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & S2N(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  952.                 End If
  953.             End If
  954.           
  955.           Case 2   '仓库
  956.              If Trim(.LrText(0).Text) <> "" Then
  957.                 Str_WH = Trim(.LrText(0).Tag)
  958.                 Sqlstr1 = Sqlstr1 & " and whcode='" & Str_WH & "'"
  959.                 Sqlstr2 = Sqlstr2 & " and whcode='" & Str_WH & "'"
  960.                 Str_QueryCondi = Str_QueryCondi & " and whcode='" & Str_WH & "'"
  961.              Else
  962.                 Str_WH = ""
  963.              End If
  964.          
  965.           Case 3   '物料分类
  966.             If Trim(.LrText(2).Text) <> "" Then
  967.              Dim StrTemp As String
  968.                 StrTemp = "SELECT mnumber From gy_material WHERE invsortcode LIKE '" & Trim(.LrText(2).Tag) & "%'"
  969.                 Sqlstr1 = Sqlstr1 & " and mnumber in(" & StrTemp & ")"
  970.                 Sqlstr2 = Sqlstr2 & " and mnumber in(" & StrTemp & ")"
  971.                 Str_QueryCondi = Str_QueryCondi & " and invsortcode like '" & Str_WH & "%'"
  972.             End If
  973.             
  974.           Case 4   '材料
  975.             If Trim(.LrText(3).Text) <> "" Then
  976.                 Sqlstr1 = Sqlstr1 & " and mnumber='" & Trim(.LrText(3).Text) & "'"
  977.                 Sqlstr2 = Sqlstr2 & " and mnumber='" & Trim(.LrText(3).Text) & "'"
  978.             End If
  979.              
  980.           Case 5   '货区
  981.             If Trim(.LrText(1).Text) <> "" Then
  982.                 Sqlstr1 = Sqlstr1 & " and marea='" & Trim(.LrText(1).Tag) & "'"
  983.                 Sqlstr2 = Sqlstr2 & " and marea='" & Trim(.LrText(1).Tag) & "'"
  984.                 Str_QueryCondi = Str_QueryCondi & " and marea='" & Trim(.LrText(1).Tag) & "'"
  985.             End If
  986.         End Select
  987.     Next jsqte
  988.  End With
  989.  Sqlstr = Sqlstr1 & " union " & Sqlstr2 & " order by mnumber"
  990. Set adoMate = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  991. If Not adoMate.EOF Then
  992.  adoMate.MoveFirst
  993.  Call Show_Tab(adoMate)
  994. Else
  995.  Label1 = "物料分类:   "
  996.  Label2 = "物料编码:   " & KF_FrmStockAccCxtj.LrText(3).Text
  997.  Label3 = "物料名称:   " & KF_FrmStockAccCxtj.Label2.Caption
  998.  Label4 = "规格型号:   "
  999.  Label5 = "计量单位:   "
  1000.  CxbbGrid.Clear 1
  1001.  CxbbGrid.Rows = CxbbGrid.FixedRows
  1002. End If
  1003. End Sub
  1004. Private Sub Show_Tab(adoTemp As Recordset)
  1005. Dim StrQC As String
  1006. Dim adoStart As New ADODB.Recordset
  1007. Dim InCount As Double
  1008. Dim OutCount As Double
  1009. Dim StrBill As String
  1010. Label1 = "物料分类:   " & Trim(adoTemp.Fields("invsortname"))
  1011. Label2 = "物料编码:   " & Trim(adoTemp.Fields("mnumber"))
  1012. Label3 = "物料名称:   " & Trim(adoTemp.Fields("mname"))
  1013. Label4 = "规格型号:   " & Trim(adoTemp.Fields("model"))
  1014. Label5 = "计量单位:   " & Trim(adoTemp.Fields("primaryunitname"))
  1015.  StrQC = "SELECT mnumber, SUM(startquan) AS Start_quan, SUM(receiptquan) AS In_quan, " & _
  1016.       "SUM(issuequan) As Out_quan From kf_v_ledger where " & Str_QueryCondi & " and mnumber='" & Trim(adoTemp.Fields("mnumber")) & "' group by mnumber"
  1017.  Set adoStart = Cw_DataEnvi.DataConnect.Execute(StrQC)
  1018.   StrBill = "select * from kf_v_inout where " & Str_QueryCondi & " and mnumber='" & Trim(adoTemp.Fields("mnumber")) & "' and billcode<>'1212' order by period,billdate"
  1019.  Set adoQuery = Cw_DataEnvi.DataConnect.Execute(StrBill)
  1020.  
  1021.   CxbbGrid.Rows = CxbbGrid.FixedRows
  1022.    CxbbGrid.AddItem ""
  1023.   With adoStart
  1024.     If Not .EOF Then
  1025.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = "期初结存"
  1026.         If S2N(.Fields("start_quan")) <> 0 Then
  1027.             CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("007", GridStr(), Szzls)) = .Fields("start_quan")
  1028.         Else
  1029.             If adoQuery.EOF Then
  1030.                 CxbbGrid.Clear 1
  1031.                 Exit Sub
  1032.             End If
  1033.         End If
  1034.     Else
  1035.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = "期初结存"
  1036.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("007", GridStr(), Szzls)) = ""
  1037.         If adoQuery.EOF Then
  1038.             CxbbGrid.Clear 1
  1039.             Exit Sub
  1040.         End If
  1041.     End If
  1042.   End With
  1043.  
  1044.  With adoQuery
  1045.     jsqte = CxbbGrid.FixedRows + 1
  1046.    Do While Not .EOF
  1047.   
  1048.      If jsqte >= CxbbGrid.Rows Then
  1049.      End If
  1050.         CxbbGrid.AddItem ""
  1051.         
  1052.       CxbbGrid.TextMatrix(jsqte, 0) = .Fields("period")
  1053.       CxbbGrid.TextMatrix(jsqte, 1) = S2N(.Fields("inoutmainid"))
  1054.       
  1055.      If IsNull(.Fields("billdate")) Then
  1056.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = ""
  1057.      Else
  1058.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Format(Trim(.Fields("billdate") & ""), "yyyy-mm-dd")        '日期
  1059.      End If
  1060.      
  1061.      If IsNull(.Fields("billnum")) Then
  1062.         CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = ""
  1063.      Else
  1064.         CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("billnum") & "")                               '单据号
  1065.      End If
  1066.       For j = 2 To 8
  1067.            If CxbbGrid.TextMatrix(0, j) <> "" Then                                                                              '摘要
  1068.                CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) & Trim(.Fields(Trim(CxbbGrid.TextMatrix(0, j)))) & ","
  1069.            End If
  1070.       Next j
  1071.       CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("whname"))                                       '仓库
  1072.      
  1073.      If S2N(.Fields("factreceiptquan") & "") <> 0 Then
  1074.         CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = S2N(.Fields("factreceiptquan") & "")                        '入库数量
  1075.      End If
  1076.      If S2N(.Fields("factissuequan")) <> 0 Then
  1077.          CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("factissuequan"))                             '出库数量
  1078.      End If
  1079.                                                                                                                                 '结存
  1080.      CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = S2N(CxbbGrid.TextMatrix(jsqte - 1, Sydz("007", GridStr(), Szzls))) + S2N(CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls))) - S2N(CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)))
  1081.      CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("mareaname") & "")
  1082.      
  1083.      CxbbGrid.RowHeight(jsqte) = Sjhgd
  1084.      
  1085.      jsqte = jsqte + 1
  1086.     .MoveNext
  1087.    Loop
  1088.    If S2N(.RecordCount) > 0 Then
  1089.         CxbbGrid.SubTotal flexSTSum, 0, Sydz("005", GridStr(), Szzls), , , , , "0"                                              '汇总
  1090.             If S2N(CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls))) = 0 Then
  1091.                 CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = ""
  1092.             End If
  1093.     
  1094.         CxbbGrid.SubTotal flexSTSum, 0, Sydz("006", GridStr(), Szzls), , , , , "0"
  1095.             If S2N(CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls))) = 0 Then                                          '汇总
  1096.                 CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = ""
  1097.             End If
  1098.             
  1099.       i = CxbbGrid.FixedRows
  1100.       InCount = 0
  1101.       OutCount = 0
  1102.       Do While i <= CxbbGrid.Rows - 1
  1103.        If Trim(CxbbGrid.TextMatrix(i, 0)) = "0" Then
  1104.     
  1105.             If S2N(CxbbGrid.TextMatrix(i - 1, Sydz("007", GridStr(), Szzls))) <> 0 Then
  1106.                CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls)) = CxbbGrid.TextMatrix(i - 1, Sydz("007", GridStr(), Szzls))
  1107.             End If
  1108.     
  1109.             CxbbGrid.TextMatrix(i, 1) = 0
  1110.             CxbbGrid.TextMatrix(i, Sydz("003", GridStr(), Szzls)) = "本月合计"
  1111.     
  1112.             If CxbbGrid.TextMatrix(i, Sydz("005", GridStr(), Szzls)) <> "" Then
  1113.                InCount = InCount + FormatNumber(CxbbGrid.TextMatrix(i, Sydz("005", GridStr(), Szzls)), Xtslxsws)
  1114.             End If
  1115.             If CxbbGrid.TextMatrix(i, Sydz("006", GridStr(), Szzls)) <> "" Then
  1116.                OutCount = OutCount + FormatNumber(CxbbGrid.TextMatrix(i, Sydz("006", GridStr(), Szzls)), Xtslxsws)
  1117.             End If
  1118.     
  1119.             CxbbGrid.AddItem "", i + 1
  1120.             CxbbGrid.TextMatrix(i + 1, 1) = 0
  1121.             CxbbGrid.TextMatrix(i + 1, Sydz("003", GridStr(), Szzls)) = "本年累计"
  1122.     
  1123.             If S2N(CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls))) <> 0 Then
  1124.                 CxbbGrid.TextMatrix(i + 1, Sydz("007", GridStr(), Szzls)) = CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls))
  1125.             End If
  1126.     
  1127.             If InCount <> 0 Then
  1128.                 CxbbGrid.TextMatrix(i + 1, Sydz("005", GridStr(), Szzls)) = InCount
  1129.             End If
  1130.     
  1131.             If OutCount <> 0 Then
  1132.                 CxbbGrid.TextMatrix(i + 1, Sydz("006", GridStr(), Szzls)) = OutCount
  1133.             End If
  1134.     
  1135.         End If
  1136.          CxbbGrid.RowHeight(i) = Sjhgd
  1137.          i = i + 1
  1138.       Loop
  1139.      End If
  1140.  End With
  1141.  ']以上为用户自定义部分
  1142.    Call SLGSH
  1143. End Sub
  1144. Private Sub CxbbGrid_DblClick()          '用户双击网格调入相应单据
  1145.     Dim RecTemp As New ADODB.Recordset
  1146.   
  1147.     '当第一次查询结果为空时,判断总记录行是否与固定行数相同,如相同则出现错误(双表头出现此情况)
  1148.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then
  1149.         Exit Sub
  1150.     End If
  1151.     '非数据行退出
  1152.     If CxbbGrid.Row < CxbbGrid.FixedRows Then
  1153.        Exit Sub
  1154.     End If
  1155.   
  1156.     Sqlstr = "SELECT inoutmainid,billcode From kf_v_inout" & _
  1157.              " Where inoutmainid=" & S2N(CxbbGrid.TextMatrix(CxbbGrid.Row, 1))
  1158.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1159.         
  1160.     Me.MousePointer = 11
  1161.     If S2N(CxbbGrid.TextMatrix(CxbbGrid.Row, 1)) = 0 Then
  1162.          Tsxx = "此项目不能显示!"
  1163.          Call Xtxxts(Tsxx, 0, 4)
  1164.          Me.MousePointer = 1
  1165.          Exit Sub
  1166.          
  1167.     Else
  1168.  
  1169.     With RecTemp
  1170.       If .EOF Then
  1171.          Tsxx = "此单据已被其它用户删除!"
  1172.          Call Xtxxts(Tsxx, 0, 4)
  1173.          Me.MousePointer = 1
  1174.          Exit Sub
  1175.       Else
  1176.        Xtcdcs = "3"
  1177.        XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 1)
  1178.         Select Case Trim(.Fields("billcode"))
  1179.             Case "1201"
  1180.                 With KF_FrmStockIn
  1181.                     '填充查询单据标识
  1182.                     .Show 1
  1183.                 End With
  1184.             Case "1202"
  1185.                 With KF_FrmProductIn
  1186.                     '填充查询单据标识
  1187.                     .Show 1
  1188.                 End With
  1189.             Case "1203"
  1190.                 With KF_FrmOtherIn
  1191.                     '填充查询单据标识
  1192.                     .Show 1
  1193.                 End With
  1194.             Case "1204"
  1195.                 With KF_FrmMateOut
  1196.                     '填充查询单据标识
  1197.                     .Show 1
  1198.                 End With
  1199.             Case "1205"
  1200.                 With KF_FrmSellOut
  1201.                     '填充查询单据标识
  1202.                     .Show 1
  1203.                 End With
  1204.             Case "1206"
  1205.                 With KF_FrmOtherOut
  1206.                     '填充查询单据标识
  1207.                     .Show 1
  1208.                 End With
  1209.          End Select
  1210.        If Xtfhcs = "1" Then
  1211.              Tsxx = "单据发生变化,是否刷新单据列表?"
  1212.              Yhanswer = Xtxxts(Tsxx, 2, 2)
  1213.              If Yhanswer = 1 Then
  1214.                 Call Timer1_Timer
  1215.              End If
  1216.        End If
  1217.         
  1218.      End If
  1219.     End With
  1220.     Me.MousePointer = 1
  1221.  End If
  1222. End Sub
  1223. Private Sub SLGSH()
  1224.  With CxbbGrid
  1225.    For hjsq = .FixedRows To .Rows - 1
  1226.     For ljsq = Qslz + 5 To .Cols - 1
  1227.      .TextMatrix(hjsq, ljsq) = Format(Trim(.TextMatrix(hjsq, ljsq)), "#,##0." + String(Xtslxsws, "0"))
  1228.      If S2N(.TextMatrix(hjsq, ljsq)) = 0 Then
  1229.       .TextMatrix(hjsq, ljsq) = ""
  1230.      End If
  1231.     Next ljsq
  1232.    Next hjsq
  1233.  End With
  1234. End Sub
  1235. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1236.     
  1237.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1238.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1239.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1240.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1241.     ReDim Bbxbt(1 To Bbxbtgs)
  1242.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1243.     If Bbbwhgs <> 0 Then
  1244.         ReDim Bbbwh(1 To Bbbwhgs)
  1245.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1246.     End If
  1247.     Bbzbt = ReportTitle
  1248.     Bbxbt(1) = Space(5) + Fun_FormatOutPut(Trim(Label1), 30)
  1249.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Label2), 30)
  1250.     Bbxbt(2) = Space(5) + Fun_FormatOutPut(Trim(Label3), 30)
  1251.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label4), 30)
  1252.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label5), 30)
  1253.     
  1254.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1255.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1256.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1257.     If Not bbylte Then
  1258.         Unload DY_Tybbyldy
  1259.     End If
  1260. End Sub
  1261. Private Sub Sub_Lxdy()                                 '帐页连续打印(帐页每批尽量少选)
  1262.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1263.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1264.     Dim jsqte As Integer
  1265.     Dim YAnswer As Integer
  1266.     
  1267.     '[[
  1268.     If adoMate.State = 0 Then Exit Sub
  1269.     ']]
  1270.     '用户确认是否开始连续打印帐页
  1271.     Tsxx = "请确认是否开始连续打印帐页?"
  1272.     YAnswer = Xtxxts(Tsxx, 2, 2)
  1273.     If YAnswer <> 1 Then
  1274.         Exit Sub
  1275.     End If
  1276.     
  1277.     '初始化连续打印状态
  1278.     Cmd_CancelPrint.Visible = True
  1279.     Cmd_CancelPrint.SetFocus
  1280.     Cmd_CancelPrint.Refresh
  1281.     Bln_CancelPrint = False
  1282.     Bln_Printing = True
  1283.     
  1284.     '循环输出打印作业
  1285.     If adoMate.RecordCount > 0 Then
  1286.         adoMate.MoveFirst
  1287.         For jsqte = 1 To adoMate.RecordCount
  1288.             Call Show_Tab(adoMate)
  1289.             Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1290.             Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1291.             ReDim Bbxbt(1 To Bbxbtgs)
  1292.             ReDim bbxbtzzxs(1 To Bbxbtgs)
  1293.             If Bbbwhgs <> 0 Then
  1294.                 ReDim Bbbwh(1 To Bbbwhgs)
  1295.                 ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1296.             End If
  1297.             Bbzbt = ReportTitle
  1298.             Bbxbt(1) = Space(5) + Fun_FormatOutPut(Trim(Label1), 30)
  1299.             Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Label2), 30)
  1300.             Bbxbt(2) = Space(5) + Fun_FormatOutPut(Trim(Label3), 30)
  1301.             Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label4), 30)
  1302.             Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label5), 30)
  1303.             bbxbtzzxs(1) = 1                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1304.             Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1305.             Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, False, True)
  1306.             Unload DY_Tybbyldy
  1307.             DoEvents
  1308.             If Bln_CancelPrint Then
  1309.                 Bln_Printing = False
  1310.                 Exit Sub
  1311.             End If
  1312.             adoMate.MoveNext
  1313.         Next jsqte
  1314.         Bln_Printing = False
  1315.         Cmd_CancelPrint.Visible = False
  1316.     End If
  1317. End Sub
  1318. Private Sub Cmd_CancelPrint_Click()                    '取消帐页连续打印
  1319.     Bln_CancelPrint = True
  1320.     Cmd_CancelPrint.Visible = False
  1321. End Sub