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

企业管理

开发平台:

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