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

企业管理

开发平台:

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_FrmMateAcc 
  5.    Caption         =   "帐簿分析_材料台帐"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   8880
  10.    HelpContextID   =   5001
  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            =   6900
  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   =   40
  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.          EndProperty
  417.       End
  418.    End
  419.    Begin MSComctlLib.Toolbar SzToolbar 
  420.       Align           =   1  'Align Top
  421.       Height          =   555
  422.       Left            =   0
  423.       TabIndex        =   4
  424.       Top             =   0
  425.       Width           =   8880
  426.       _ExtentX        =   15663
  427.       _ExtentY        =   979
  428.       ButtonWidth     =   820
  429.       ButtonHeight    =   926
  430.       AllowCustomize  =   0   'False
  431.       Appearance      =   1
  432.       Style           =   1
  433.       ImageList       =   "ImageList1"
  434.       _Version        =   393216
  435.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  436.          NumButtons      =   17
  437.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  438.             Caption         =   "设置"
  439.             Key             =   "ymsz"
  440.             ImageKey        =   "sz"
  441.          EndProperty
  442.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  443.             Caption         =   "打印"
  444.             Key             =   "dy"
  445.             ImageKey        =   "dy"
  446.          EndProperty
  447.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  448.             Caption         =   "预览"
  449.             Key             =   "yl"
  450.             ImageKey        =   "yl"
  451.          EndProperty
  452.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  453.             Caption         =   "连打"
  454.             Key             =   "ld"
  455.             ImageKey        =   "ld"
  456.          EndProperty
  457.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  458.             Style           =   3
  459.          EndProperty
  460.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  461.             Caption         =   "查询"
  462.             Key             =   "cx"
  463.             ImageKey        =   "cx"
  464.          EndProperty
  465.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  466.             Caption         =   "单据"
  467.             Key             =   "Bill"
  468.             ImageKey        =   "pz"
  469.          EndProperty
  470.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  471.             Style           =   3
  472.          EndProperty
  473.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  474.             Caption         =   "摘要"
  475.             Key             =   "zy"
  476.             ImageKey        =   "define"
  477.          EndProperty
  478.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  479.             Style           =   3
  480.          EndProperty
  481.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  482.             Caption         =   "首张"
  483.             Key             =   "first"
  484.             ImageKey        =   "first"
  485.          EndProperty
  486.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  487.             Caption         =   "上张"
  488.             Key             =   "prev"
  489.             ImageKey        =   "prev"
  490.          EndProperty
  491.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  492.             Caption         =   "下张"
  493.             Key             =   "next"
  494.             ImageKey        =   "next"
  495.          EndProperty
  496.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  497.             Caption         =   "末张"
  498.             Key             =   "last"
  499.             ImageKey        =   "last"
  500.          EndProperty
  501.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  502.             Style           =   3
  503.          EndProperty
  504.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  505.             Caption         =   "帮助"
  506.             Key             =   "bz"
  507.             ImageKey        =   "bz"
  508.          EndProperty
  509.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  510.             Caption         =   "退出"
  511.             Key             =   "fh"
  512.             ImageKey        =   "tc"
  513.          EndProperty
  514.       EndProperty
  515.       BorderStyle     =   1
  516.       Begin MSComctlLib.ImageList ImageList1 
  517.          Left            =   6990
  518.          Top             =   30
  519.          _ExtentX        =   1005
  520.          _ExtentY        =   1005
  521.          BackColor       =   -2147483643
  522.          ImageWidth      =   16
  523.          ImageHeight     =   16
  524.          MaskColor       =   12632256
  525.          _Version        =   393216
  526.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  527.             NumListImages   =   33
  528.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  529.                Picture         =   "帐簿分析_材料台帐查询结果.frx":28AD4
  530.                Key             =   "sz"
  531.             EndProperty
  532.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  533.                Picture         =   "帐簿分析_材料台帐查询结果.frx":28E6E
  534.                Key             =   "dy"
  535.             EndProperty
  536.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  537.                Picture         =   "帐簿分析_材料台帐查询结果.frx":29208
  538.                Key             =   "yl"
  539.             EndProperty
  540.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  541.                Picture         =   "帐簿分析_材料台帐查询结果.frx":295A2
  542.                Key             =   "xg"
  543.             EndProperty
  544.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  545.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2993C
  546.                Key             =   "zh"
  547.             EndProperty
  548.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  549.                Picture         =   "帐簿分析_材料台帐查询结果.frx":29CD6
  550.                Key             =   "sh"
  551.             EndProperty
  552.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  553.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2A070
  554.                Key             =   "bc"
  555.             EndProperty
  556.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  557.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2A40A
  558.                Key             =   "fq"
  559.             EndProperty
  560.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  561.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2A7A4
  562.                Key             =   "bz"
  563.             EndProperty
  564.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  565.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2AB3E
  566.                Key             =   "tc"
  567.             EndProperty
  568.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  569.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2AED8
  570.                Key             =   "bcgs"
  571.             EndProperty
  572.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  573.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2B272
  574.                Key             =   "mrlk"
  575.             EndProperty
  576.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  577.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2B60C
  578.                Key             =   "xsxm"
  579.             EndProperty
  580.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  581.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2B9A6
  582.                Key             =   "first"
  583.             EndProperty
  584.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  585.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2BD40
  586.                Key             =   "prev"
  587.             EndProperty
  588.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  589.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2C0DA
  590.                Key             =   "next"
  591.             EndProperty
  592.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  593.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2C474
  594.                Key             =   "last"
  595.             EndProperty
  596.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  597.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2C80E
  598.                Key             =   "xx"
  599.             EndProperty
  600.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  601.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2CBA8
  602.                Key             =   "define"
  603.             EndProperty
  604.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  605.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2CF42
  606.                Key             =   "exec"
  607.             EndProperty
  608.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  609.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2D2DC
  610.                Key             =   "xz"
  611.             EndProperty
  612.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  613.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2D676
  614.                Key             =   "sc"
  615.             EndProperty
  616.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  617.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2DA10
  618.                Key             =   "sx"
  619.             EndProperty
  620.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  621.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2DDAA
  622.                Key             =   "cx"
  623.             EndProperty
  624.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  625.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2E144
  626.                Key             =   "zd"
  627.             EndProperty
  628.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  629.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2E4DE
  630.                Key             =   "dz"
  631.             EndProperty
  632.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  633.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2E878
  634.                Key             =   "ph"
  635.             EndProperty
  636.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  637.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2EC12
  638.                Key             =   "fz"
  639.             EndProperty
  640.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  641.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2EFAC
  642.                Key             =   "dw"
  643.             EndProperty
  644.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  645.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2F346
  646.                Key             =   "hf"
  647.             EndProperty
  648.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  649.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2F6E0
  650.                Key             =   "pz"
  651.             EndProperty
  652.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  653.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2FA7A
  654.                Key             =   "check"
  655.             EndProperty
  656.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  657.                Picture         =   "帐簿分析_材料台帐查询结果.frx":2FE14
  658.                Key             =   "ld"
  659.             EndProperty
  660.          EndProperty
  661.       End
  662.    End
  663. End
  664. Attribute VB_Name = "KF_FrmMateAcc"
  665. Attribute VB_GlobalNameSpace = False
  666. Attribute VB_Creatable = False
  667. Attribute VB_PredeclaredId = True
  668. Attribute VB_Exposed = False
  669. '**************************************************************************
  670. '*    模 块 名 称 :库存材料帐
  671. '*    功 能 描 述 :
  672. '*    程序员姓名  :张万成
  673. '*    最后修改人  :张万成
  674. '*    最后修改时间:2001/12/06
  675. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  676. '**************************************************************************
  677. Dim ReportTitle As String                '报表主标题
  678. Dim Str_QueryCondi As String             '用户录入查询条件
  679. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  680. Dim Bln_CancelPrint As Boolean           '用户是否取消打印
  681. Dim Bln_Printing As Boolean              '用户是否正在打印
  682. '以下为固定使用变量
  683. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  684. Dim GridCode As String                   '显示网格网格代码
  685. Dim GridInf() As Variant                 '整个网格设置信息
  686. Dim Tsxx As String                       '系统提示信息
  687. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  688. Dim Sjhgd As Double                      '网格数据行高度
  689. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  690. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  691. Dim GridStr()  As String                 '网格列信息(字符型)
  692. Dim GridInt() As Integer                 '网格列信息(整型)
  693. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  694. Dim adoMate As New ADODB.Recordset
  695. Dim adoQuery As New ADODB.Recordset
  696. Public Bln As Boolean
  697. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  698.     On Error Resume Next
  699.     With CxbbGrid
  700.         .Width = Me.Width - 160
  701.         .Height = Me.Height - .Top - 400
  702.     End With
  703.     With Pic_Title
  704.         .Width = Me.Width - 160
  705.     End With
  706.     
  707.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  708. End Sub
  709. Private Sub Form_Load()                                                   '窗体装入
  710.   
  711.     '调入打印页面设置窗体
  712.     ReportTitle = "材料台帐"
  713.     XtReportCode = "KF_MateAcc"
  714.     Load Dyymctbl
  715.       
  716.     '调整标题栏及网格、格式工具条位置(Fixed)
  717.     Pic_Title.Left = 40
  718.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  719.     CxbbGrid.Left = Pic_Title.Left
  720.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  721.      
  722.     '调 入 网 格(Fixed)
  723.     GridCode = "KF_StockAcc"
  724.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  725.       
  726.     Qslz = GridInf(1)
  727.     Sjhgd = GridInf(2)
  728.     Sfxshjwg = GridInf(7)
  729.     Szzls = CxbbGrid.Cols - 1
  730.     
  731.     
  732. End Sub
  733. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  734.     '卸载条件窗体
  735.     KF_FrmMateAccCxtj.UnloadCheck.Value = 1
  736.     Unload KF_FrmMateAccCxtj
  737.     Unload KF_FrmDigest
  738.     '卸载打印页面设置窗体
  739.     Unload Dyymctbl
  740. End Sub
  741. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  742.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  743. End Sub
  744. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  745.   
  746.     Select Case Button.Key
  747.         Case "bcgs"                                          '保存表格格式
  748.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  749.         Case "hfmrgs"                                        '恢复默认格式
  750.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  751.         Case "szxsxm"                                        '设置显示项目
  752.             Call Szxsxm(CxbbGrid, GridCode)
  753.     End Select
  754. End Sub
  755. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  756.     
  757.     Select Case Button.Key
  758.         Case "ymsz"                                          '页面设置
  759.             Dyymctbl.Show 1
  760.         Case "yl"                                            '预 览
  761.             Call bbyl(True)
  762.         Case "dy"                                            '打 印
  763.             Call bbyl(False)
  764.         Case "ld"
  765.             Call Sub_Lxdy
  766.         Case "cx"                                            '查 询
  767.             KF_FrmMateAccCxtj.Show 1
  768.         Case "Bill"
  769.             Call CxbbGrid_DblClick
  770.         Case "zy"
  771.             If adoMate.State = 1 Then
  772.                 If adoMate.RecordCount > 0 Then
  773.                     KF_FrmDigest.Label1.Caption = "3"
  774.                     KF_FrmDigest.Show 1
  775.                     If Not Bln Then
  776.                         If adoMate.EOF Then
  777.                             adoMate.MoveLast
  778.                         ElseIf adoMate.BOF Then
  779.                             adoMate.MoveFirst
  780.                         End If
  781.                         Call Show_Tab(adoMate)
  782.                     End If
  783.                 End If
  784.             End If
  785.         Case "first"
  786.             Call First
  787.         Case "last"
  788.             Call Last
  789.         Case "prev"
  790.             Call Prev
  791.         Case "next"
  792.             Call Sub_next
  793.         Case "bz"                                            '帮 助
  794.             Call F1bz
  795.         Case "fh"                                            '退 出
  796.            Unload Me
  797.     End Select
  798. End Sub
  799. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  800.     
  801.     Timer1.Enabled = False
  802.     Xt_Wait.Show
  803.     Xt_Wait.Refresh
  804.    
  805.     '加快显示速度
  806.     CxbbGrid.Redraw = False
  807.  
  808.     '生成查询结果
  809.     Call Sub_Query(0)
  810.    
  811.     CxbbGrid.Redraw = True
  812.     
  813.     Xt_Wait.Hide
  814. End Sub
  815. Private Sub First()         '首张
  816.     If adoMate.State = 1 Then
  817.         If adoMate.RecordCount > 0 Then
  818.             adoMate.MoveFirst
  819.             intNowRec = 1
  820.             SzToolbar.Buttons("first").Enabled = False
  821.             SzToolbar.Buttons("prev").Enabled = False
  822.             SzToolbar.Buttons("next").Enabled = True
  823.             SzToolbar.Buttons("last").Enabled = True
  824.             Call Show_Tab(adoMate)
  825.         End If
  826.     End If
  827. End Sub
  828. Private Sub Last()          '末张
  829.     If adoMate.State = 1 Then
  830.         If adoMate.RecordCount > 0 Then
  831.             adoMate.MoveLast
  832.             intNowRec = conRecNum
  833.             SzToolbar.Buttons("next").Enabled = False
  834.             SzToolbar.Buttons("last").Enabled = False
  835.             SzToolbar.Buttons("first").Enabled = True
  836.             SzToolbar.Buttons("prev").Enabled = True
  837.             Call Show_Tab(adoMate)
  838.         End If
  839.     End If
  840. End Sub
  841. Private Sub Prev()          '上张
  842.     If adoMate.State = 1 Then
  843.         SzToolbar.Buttons("next").Enabled = True
  844.         SzToolbar.Buttons("last").Enabled = True
  845.         If adoMate.RecordCount > 0 Then
  846.             intNowRec = intNowRec - 1
  847.             If adoMate.EOF Then
  848.                 adoMate.MovePrevious
  849.             End If
  850.             If Not adoMate.BOF Then
  851.                 adoMate.MovePrevious
  852.                 If Not adoMate.BOF Then
  853.                     Call Show_Tab(adoMate)
  854.                 End If
  855.             End If
  856.             If adoMate.BOF Then
  857.                 SzToolbar.Buttons("first").Enabled = False
  858.                 SzToolbar.Buttons("prev").Enabled = False
  859.             End If
  860.             
  861.         End If
  862.     End If
  863. End Sub
  864. Private Sub Sub_next()          '下张
  865.     If adoMate.State = 1 Then
  866.         If adoMate.RecordCount > 0 Then
  867.             SzToolbar.Buttons("first").Enabled = True
  868.             SzToolbar.Buttons("prev").Enabled = True
  869.             intNowRec = intNowRec + 1
  870.             If adoMate.BOF Then
  871.                 adoMate.MoveNext
  872.             End If
  873.             If Not adoMate.EOF Then
  874.                 adoMate.MoveNext
  875.                 If Not adoMate.EOF Then
  876.                     Call Show_Tab(adoMate)
  877.                 End If
  878.             End If
  879.             If adoMate.EOF Then
  880.                 SzToolbar.Buttons("next").Enabled = False
  881.                 SzToolbar.Buttons("last").Enabled = False
  882.             End If
  883.         End If
  884.     End If
  885. End Sub
  886. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  887.     
  888.    Dim Sqlstr1 As String                        '查询字符串
  889.    Dim Sqlstr2 As String
  890.    Dim Sqlstr As String
  891.    Dim Coljsq As Long                          '网格列计数器
  892.    Dim jsqte As Integer                        '临时动态计数器
  893.    Dim Xtyear As Integer
  894.    Dim Period As Integer
  895.    Dim adoPeriod As New ADODB.Recordset
  896.    
  897.  '以下为用户自定义部分[
  898.  With KF_FrmMateAccCxtj
  899.      
  900.      '显示查询会计期间
  901.      Sqlstr1 = "select mnumber,(select mname from gy_material where kf_v_mledger.mnumber=gy_material.mnumber) as mname, " & _
  902.                " (select model from gy_material where kf_v_mledger.mnumber=gy_material.mnumber) as model, " & _
  903.                " (select primaryunitname from gy_material where kf_v_mledger.mnumber=gy_material.mnumber) as primaryunitname, " & _
  904.                " (select invsortname from KF_V_InvSort where kf_v_mledger.mnumber=KF_V_InvSort.mnumber) as invsortname" & _
  905.                " from kf_v_mledger where 1=1 "
  906.      Sqlstr2 = "select  mnumber, (select mname from gy_material where kf_v_mateinout.mnumber=gy_material.mnumber) as mname, " & _
  907.                " (select model from gy_material where kf_v_mateinout.mnumber=gy_material.mnumber) as model, " & _
  908.                " (select primaryunitname from gy_material where kf_v_mateinout.mnumber=gy_material.mnumber) as primaryunitname,  " & _
  909.                " (select invsortname from KF_V_InvSort where kf_v_mateinout.mnumber=KF_V_InvSort.mnumber) as invsortname" & _
  910.                " from kf_v_mateinout where billcode not in('1201','1202','1203') "
  911.      
  912.      Xtyear = Val(Mid(Trim(.Combo_Kjqj2.Text), 1, 4))
  913.      Period = Val(Mid(Trim(.Combo_Kjqj2.Text), 6))
  914.      Str_QueryCondi = ""
  915.      Set adoPeriod = Cw_DataEnvi.DataConnect.Execute("select period from gy_kjrlb where beginflag=1 and kjyear=" & Xtyear)
  916.      
  917.      For jsqte = 1 To 5
  918.         Select Case jsqte
  919.           
  920.            Case 1  '会计期间
  921.             If Trim(.Combo_Kjqj2.Text) <> "" Then
  922.                 If Not adoPeriod.EOF Then
  923.                     If Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) < Val(adoPeriod.Fields("period")) Then
  924.                         Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & Val(adoPeriod.Fields("period")) & " and " & Period
  925.                         Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & Val(adoPeriod.Fields("period")) & " and " & Period
  926.                         Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & Val(adoPeriod.Fields("period")) & " and " & Period
  927.                     Else
  928.                         Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  929.                         Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  930.                         Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  931.                     End If
  932.                 Else
  933.                     Sqlstr1 = Sqlstr1 & " and kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  934.                     Sqlstr2 = Sqlstr2 & " and kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  935.                     Str_QueryCondi = Str_QueryCondi & "  kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  936.                 End If
  937.             End If
  938.             
  939.           Case 2   '仓库
  940.              If Trim(.LrText(0).Text) <> "" Then
  941.                 Str_WH = Trim(.LrText(0).Tag)
  942.                 Sqlstr1 = Sqlstr1 & " and whcode='" & Str_WH & "'"
  943.                 Sqlstr2 = Sqlstr2 & " and whcode='" & Str_WH & "'"
  944.                 Str_QueryCondi = Str_QueryCondi & " and whcode='" & Str_WH & "'"
  945.              Else
  946.                 Str_WH = ""
  947.              End If
  948.          
  949.           Case 3   '物料分类
  950.             If Trim(.LrText(2).Text) <> "" Then
  951.              Dim StrTemp As String
  952.                 StrTemp = "SELECT mnumber From gy_material WHERE invsortcode LIKE '" & Trim(.LrText(2).Tag) & "%'"
  953.                 Sqlstr1 = Sqlstr1 & " and mnumber in(" & StrTemp & ")"
  954.                 Sqlstr2 = Sqlstr2 & " and mnumber in(" & StrTemp & ")"
  955.                 Str_QueryCondi = Str_QueryCondi & " and invsortcode like '" & Str_WH & "%'"
  956.             End If
  957.             
  958.           Case 4   '材料
  959.             If Trim(.LrText(3).Text) <> "" Then
  960.                 Sqlstr1 = Sqlstr1 & " and mnumber='" & Trim(.LrText(3).Text) & "'"
  961.                 Sqlstr2 = Sqlstr2 & " and mnumber='" & Trim(.LrText(3).Text) & "'"
  962.             End If
  963.              
  964.           Case 5   '货区
  965.             If Trim(.LrText(1).Text) <> "" Then
  966.                 Sqlstr1 = Sqlstr1 & " and marea='" & Trim(.LrText(1).Tag) & "'"
  967.                 Sqlstr2 = Sqlstr2 & " and marea='" & Trim(.LrText(1).Tag) & "'"
  968.                 Str_QueryCondi = Str_QueryCondi & " and marea='" & Trim(.LrText(1).Tag) & "'"
  969.             End If
  970.         End Select
  971.     Next jsqte
  972.  End With
  973.  Sqlstr = Sqlstr1 & " union " & Sqlstr2 & " order by mnumber"
  974. Set adoMate = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  975. If Not adoMate.EOF Then
  976.  adoMate.MoveFirst
  977.  Call Show_Tab(adoMate)
  978. Else
  979.  Label1 = "物料分类:   "
  980.  Label2 = "物料编码:   " & KF_FrmMateAccCxtj.LrText(3).Text
  981.  Label3 = "物料名称:   " & KF_FrmMateAccCxtj.Label2.Caption
  982.  Label4 = "规格型号:   "
  983.  Label5 = "计量单位:   "
  984.  CxbbGrid.Clear 1
  985.  CxbbGrid.Rows = CxbbGrid.FixedRows
  986. End If
  987. End Sub
  988. Private Sub Show_Tab(adoTemp As Recordset)
  989. Dim StrQC As String
  990. Dim adoStart As New ADODB.Recordset
  991. Dim InCount As Double
  992. Dim OutCount As Double
  993. Dim StrBill As String
  994. Label1 = "物料分类:   " & Trim(adoTemp.Fields("invsortname"))
  995. Label2 = "物料编码:   " & Trim(adoTemp.Fields("mnumber"))
  996. Label3 = "物料名称:   " & Trim(adoTemp.Fields("mname"))
  997. Label4 = "规格型号:   " & Trim(adoTemp.Fields("model"))
  998. Label5 = "计量单位:   " & Trim(adoTemp.Fields("primaryunitname"))
  999. '期初数据
  1000.  StrQC = "SELECT mnumber, SUM(startquan) AS Start_quan, SUM(receiptquan) AS In_quan, " & _
  1001.       "SUM(issuequan) As Out_quan From kf_v_mledger where " & Str_QueryCondi & " and mnumber='" & Trim(adoTemp.Fields("mnumber")) & "' group by mnumber"
  1002.  Set adoStart = Cw_DataEnvi.DataConnect.Execute(StrQC)
  1003. '单据发生
  1004.   StrBill = "select * from kf_v_mateinout where " & Str_QueryCondi & " and mnumber='" & Trim(adoTemp.Fields("mnumber")) & "' and billcode not in('1201','1202','1203')  order by period,billdate"
  1005.  Set adoQuery = Cw_DataEnvi.DataConnect.Execute(StrBill)
  1006.  
  1007.   CxbbGrid.Rows = CxbbGrid.FixedRows
  1008.    CxbbGrid.AddItem ""
  1009.   With adoStart
  1010. '填充期初
  1011.     If Not .EOF Then
  1012.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = "期初结存"
  1013.         If Val(.Fields("start_quan")) <> 0 Then
  1014.             CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("007", GridStr(), Szzls)) = .Fields("start_quan")
  1015.         Else
  1016.             If adoQuery.EOF Then
  1017.                 CxbbGrid.Clear 1
  1018.                 Exit Sub
  1019.             End If
  1020.         End If
  1021.     Else
  1022.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = "期初结存"
  1023.         CxbbGrid.TextMatrix(CxbbGrid.FixedRows, Sydz("007", GridStr(), Szzls)) = ""
  1024.         If adoQuery.EOF Then
  1025.             CxbbGrid.Clear 1
  1026.             Exit Sub
  1027.         End If
  1028.     End If
  1029.   End With
  1030.  
  1031.  With adoQuery
  1032.     jsqte = CxbbGrid.FixedRows + 1
  1033.    Do While Not .EOF
  1034.   
  1035.   '填充单据
  1036.      If jsqte >= CxbbGrid.Rows Then
  1037.      End If
  1038.         CxbbGrid.AddItem ""
  1039.         
  1040.       CxbbGrid.TextMatrix(jsqte, 0) = .Fields("period")
  1041.       CxbbGrid.TextMatrix(jsqte, 1) = Val(.Fields("inoutmainid"))
  1042.       
  1043.      If IsNull(.Fields("billdate")) Then
  1044.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = ""
  1045.      Else
  1046.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Format(Trim(.Fields("billdate") & ""), "yyyy-mm-dd")
  1047.      End If
  1048.      
  1049.      If IsNull(.Fields("billnum")) Then
  1050.         CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = ""
  1051.      Else
  1052.         CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("billnum") & "")
  1053.      End If
  1054.       For j = 2 To 8            '摘要
  1055.            If CxbbGrid.TextMatrix(0, j) <> "" Then
  1056.                CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) & Trim(.Fields(Trim(CxbbGrid.TextMatrix(0, j)))) & ","
  1057.            End If
  1058.       Next j
  1059.       CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("whname"))
  1060.      
  1061.      If Val(.Fields("factreceiptquan")) <> 0 Then
  1062.         CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = .Fields("factreceiptquan")
  1063.      End If
  1064.      If Val(.Fields("factissuequan")) <> 0 Then
  1065.          CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("factissuequan"))
  1066.      End If
  1067.      
  1068.      CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Val(CxbbGrid.TextMatrix(jsqte - 1, Sydz("007", GridStr(), Szzls))) + Val(CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls))) - Val(CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)))
  1069.      CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("mareaname") & "")
  1070.      
  1071.      CxbbGrid.RowHeight(jsqte) = Sjhgd
  1072.      
  1073.      jsqte = jsqte + 1
  1074.     .MoveNext
  1075.    Loop
  1076.    
  1077.    
  1078.    '汇总
  1079.   If Val(.RecordCount) > 0 Then
  1080.         CxbbGrid.SubTotal flexSTSum, 0, Sydz("005", GridStr(), Szzls), , , , , "0"
  1081.             If Val(CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls))) = 0 Then
  1082.                 CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = ""
  1083.             End If
  1084.     
  1085.         CxbbGrid.SubTotal flexSTSum, 0, Sydz("006", GridStr(), Szzls), , , , , "0"
  1086.             If Val(CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls))) = 0 Then
  1087.                 CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = ""
  1088.             End If
  1089.             
  1090.             
  1091.   '显示累计
  1092.       i = CxbbGrid.FixedRows
  1093.       InCount = 0
  1094.       OutCount = 0
  1095.       Do While i <= CxbbGrid.Rows - 1
  1096.        If Trim(CxbbGrid.TextMatrix(i, 0)) = "0" Then
  1097.     
  1098.             If Val(CxbbGrid.TextMatrix(i - 1, Sydz("007", GridStr(), Szzls))) <> 0 Then
  1099.                CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls)) = CxbbGrid.TextMatrix(i - 1, Sydz("007", GridStr(), Szzls))
  1100.             End If
  1101.     
  1102.             CxbbGrid.TextMatrix(i, 1) = 0
  1103.             CxbbGrid.TextMatrix(i, Sydz("003", GridStr(), Szzls)) = "本月合计"
  1104.     
  1105.             If CxbbGrid.TextMatrix(i, Sydz("005", GridStr(), Szzls)) <> "" Then
  1106.                InCount = InCount + FormatNumber(CxbbGrid.TextMatrix(i, Sydz("005", GridStr(), Szzls)), Xtslxsws)
  1107.             End If
  1108.             If CxbbGrid.TextMatrix(i, Sydz("006", GridStr(), Szzls)) <> "" Then
  1109.                OutCount = OutCount + FormatNumber(CxbbGrid.TextMatrix(i, Sydz("006", GridStr(), Szzls)), Xtslxsws)
  1110.             End If
  1111.     
  1112.             CxbbGrid.AddItem "", i + 1
  1113.             CxbbGrid.TextMatrix(i + 1, 1) = 0
  1114.             CxbbGrid.TextMatrix(i + 1, Sydz("003", GridStr(), Szzls)) = "本年累计"
  1115.     
  1116.             If Val(CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls))) <> 0 Then
  1117.                 CxbbGrid.TextMatrix(i + 1, Sydz("007", GridStr(), Szzls)) = CxbbGrid.TextMatrix(i, Sydz("007", GridStr(), Szzls))
  1118.             End If
  1119.     
  1120.             If InCount <> 0 Then
  1121.                 CxbbGrid.TextMatrix(i + 1, Sydz("005", GridStr(), Szzls)) = InCount
  1122.             End If
  1123.     
  1124.             If OutCount <> 0 Then
  1125.                 CxbbGrid.TextMatrix(i + 1, Sydz("006", GridStr(), Szzls)) = OutCount
  1126.             End If
  1127.     
  1128.         End If
  1129.          CxbbGrid.RowHeight(i) = Sjhgd
  1130.          i = i + 1
  1131.       Loop
  1132.    End If
  1133.  End With
  1134.  ']以上为用户自定义部分
  1135.    Call SLGSH
  1136. End Sub
  1137. Private Sub CxbbGrid_DblClick()          '用户双击网格调入相应单据
  1138.   Dim RecTemp As New ADODB.Recordset
  1139.   
  1140.   '非数据行退出
  1141.   If CxbbGrid.Row < CxbbGrid.FixedRows Then
  1142.      Exit Sub
  1143.   End If
  1144.   
  1145.     Sqlstr = "SELECT inoutmainid,billcode From kf_v_mateinout" & _
  1146.              " Where inoutmainid=" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 1))
  1147.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1148.         
  1149.     Me.MousePointer = 11
  1150.     If Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 1)) = 0 Then
  1151.          Tsxx = "此项目不能显示!"
  1152.          Call Xtxxts(Tsxx, 0, 4)
  1153.          Me.MousePointer = 1
  1154.          Exit Sub
  1155.          
  1156.     Else
  1157.  
  1158.     With RecTemp
  1159.       If .EOF Then
  1160.          Tsxx = "此单据已被其它用户删除!"
  1161.          Call Xtxxts(Tsxx, 0, 4)
  1162.          Me.MousePointer = 1
  1163.          Exit Sub
  1164.       Else
  1165.        Xtcdcs = "3"
  1166.        XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 1)
  1167.         Select Case Trim(.Fields("billcode"))
  1168.                 Case "1212"
  1169.                     With KF_FrmMateIn
  1170.                         '填充查询单据标识
  1171.                         .Show 1
  1172.                     End With
  1173.                 Case "1204"
  1174.                     With KF_FrmMateOut
  1175.                         '填充查询单据标识
  1176.                         .Show 1
  1177.                     End With
  1178.                 Case "1205"
  1179.                     With KF_FrmSellOut
  1180.                         '填充查询单据标识
  1181.                         .Show 1
  1182.                     End With
  1183.                 Case "1206"
  1184.                     With KF_FrmOtherOut
  1185.                         '填充查询单据标识
  1186.                         .Show 1
  1187.                     End With
  1188.          End Select
  1189.        If Xtfhcs = "1" Then
  1190.              Tsxx = "单据发生变化,是否刷新单据列表?"
  1191.              Yhanswer = Xtxxts(Tsxx, 2, 2)
  1192.              If Yhanswer = 1 Then
  1193.                 Call Timer1_Timer
  1194.              End If
  1195.        End If
  1196.         
  1197.      End If
  1198.     End With
  1199.     Me.MousePointer = 1
  1200.  End If
  1201. End Sub
  1202. Private Sub SLGSH()
  1203.  With CxbbGrid
  1204.    For hjsq = .FixedRows To .Rows - 1
  1205.     For ljsq = Qslz + 5 To .Cols - 1
  1206.      .TextMatrix(hjsq, ljsq) = Format(Trim(.TextMatrix(hjsq, ljsq)), "#,##0." + String(Xtslxsws, "0"))
  1207.      If Val(.TextMatrix(hjsq, ljsq)) = 0 Then
  1208.       .TextMatrix(hjsq, ljsq) = ""
  1209.      End If
  1210.     Next ljsq
  1211.    Next hjsq
  1212.  End With
  1213. End Sub
  1214. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1215.     
  1216.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1217.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1218.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1219.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1220.     ReDim Bbxbt(1 To Bbxbtgs)
  1221.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1222.     If Bbbwhgs <> 0 Then
  1223.         ReDim Bbbwh(1 To Bbbwhgs)
  1224.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1225.     End If
  1226.     Bbzbt = ReportTitle
  1227.     Bbxbt(1) = Space(5) + Fun_FormatOutPut(Trim(Label1), 30)
  1228.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Label2), 30)
  1229.     Bbxbt(2) = Space(5) + Fun_FormatOutPut(Trim(Label3), 30)
  1230.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label4), 30)
  1231.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label5), 30)
  1232.     
  1233.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1234.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1235.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1236.     If Not bbylte Then
  1237.         Unload DY_Tybbyldy
  1238.     End If
  1239. End Sub
  1240. Private Sub Sub_Lxdy()                                 '帐页连续打印(帐页每批尽量少选)
  1241.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1242.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1243.     Dim jsqte As Integer
  1244.     Dim YAnswer As Integer
  1245.     
  1246.     '[[
  1247.     If adoMate.State = 0 Then Exit Sub
  1248.     ']]
  1249.     '用户确认是否开始连续打印帐页
  1250.     Tsxx = "请确认是否开始连续打印帐页?"
  1251.     YAnswer = Xtxxts(Tsxx, 2, 2)
  1252.     If YAnswer <> 1 Then
  1253.         Exit Sub
  1254.     End If
  1255.     
  1256.     '初始化连续打印状态
  1257.     Cmd_CancelPrint.Visible = True
  1258.     Cmd_CancelPrint.SetFocus
  1259.     Cmd_CancelPrint.Refresh
  1260.     Bln_CancelPrint = False
  1261.     Bln_Printing = True
  1262.     
  1263.     '循环输出打印作业
  1264.     If adoMate.RecordCount > 0 Then
  1265.         adoMate.MoveFirst
  1266.         For jsqte = 1 To adoMate.RecordCount
  1267.             Call Show_Tab(adoMate)
  1268.             Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1269.             Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1270.             ReDim Bbxbt(1 To Bbxbtgs)
  1271.             ReDim bbxbtzzxs(1 To Bbxbtgs)
  1272.             If Bbbwhgs <> 0 Then
  1273.                 ReDim Bbbwh(1 To Bbbwhgs)
  1274.                 ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1275.             End If
  1276.             Bbzbt = ReportTitle
  1277.             Bbxbt(1) = Space(5) + Fun_FormatOutPut(Trim(Label1), 30)
  1278.             Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Label2), 30)
  1279.             Bbxbt(2) = Space(5) + Fun_FormatOutPut(Trim(Label3), 30)
  1280.             Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label4), 30)
  1281.             Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Label5), 30)
  1282.             bbxbtzzxs(1) = 1                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1283.             Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1284.             Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, False, True)
  1285.             Unload DY_Tybbyldy
  1286.             DoEvents
  1287.             If Bln_CancelPrint Then
  1288.                 Bln_Printing = False
  1289.                 Exit Sub
  1290.             End If
  1291.             adoMate.MoveNext
  1292.         Next jsqte
  1293.         Bln_Printing = False
  1294.         Cmd_CancelPrint.Visible = False
  1295.     End If
  1296. End Sub
  1297. Private Sub Cmd_CancelPrint_Click()                    '取消帐页连续打印
  1298.     Bln_CancelPrint = True
  1299.     Cmd_CancelPrint.Visible = False
  1300. End Sub