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

企业管理

开发平台:

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 ZB_FrmKmyebjg 
  5.    Caption         =   "科目发生额及余额表"
  6.    ClientHeight    =   7755
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11190
  10.    HelpContextID   =   5001
  11.    Icon            =   "帐簿_科目余额表查询结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   7755
  16.    ScaleWidth      =   11190
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.Timer Timer1 
  19.       Enabled         =   0   'False
  20.       Interval        =   1
  21.       Left            =   7620
  22.       Top             =   90
  23.    End
  24.    Begin VB.PictureBox Pic_Title 
  25.       Height          =   1155
  26.       Left            =   0
  27.       Picture         =   "帐簿_科目余额表查询结果.frx":1042
  28.       ScaleHeight     =   1095
  29.       ScaleWidth      =   11535
  30.       TabIndex        =   1
  31.       Top             =   570
  32.       Width           =   11595
  33.       Begin VB.ComboBox Combo_AccFormat 
  34.          Height          =   300
  35.          Left            =   6780
  36.          Style           =   2  'Dropdown List
  37.          TabIndex        =   6
  38.          Top             =   750
  39.          Width           =   1725
  40.       End
  41.       Begin VB.Label Label1 
  42.          Appearance      =   0  'Flat
  43.          BackColor       =   &H80000005&
  44.          BackStyle       =   0  'Transparent
  45.          Caption         =   "科目类别合计"
  46.          ForeColor       =   &H80000008&
  47.          Height          =   195
  48.          Index           =   2
  49.          Left            =   9600
  50.          TabIndex        =   10
  51.          Top             =   480
  52.          Width           =   1155
  53.       End
  54.       Begin VB.Label Lab_Color 
  55.          Appearance      =   0  'Flat
  56.          BackColor       =   &H00FFFF00&
  57.          BorderStyle     =   1  'Fixed Single
  58.          ForeColor       =   &H80000008&
  59.          Height          =   195
  60.          Index           =   0
  61.          Left            =   9360
  62.          TabIndex        =   9
  63.          Top             =   450
  64.          Width           =   195
  65.       End
  66.       Begin VB.Label Lab_TitleText 
  67.          AutoSize        =   -1  'True
  68.          BackStyle       =   0  'Transparent
  69.          ForeColor       =   &H00000000&
  70.          Height          =   180
  71.          Index           =   0
  72.          Left            =   2040
  73.          TabIndex        =   8
  74.          Top             =   810
  75.          Width           =   90
  76.       End
  77.       Begin VB.Label TsLabel 
  78.          AutoSize        =   -1  'True
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "帐页格式:"
  81.          Height          =   180
  82.          Index           =   7
  83.          Left            =   5940
  84.          TabIndex        =   7
  85.          Top             =   810
  86.          Width           =   810
  87.       End
  88.       Begin VB.Label TsLabel 
  89.          AutoSize        =   -1  'True
  90.          BackColor       =   &H80000018&
  91.          BackStyle       =   0  'Transparent
  92.          Caption         =   "科目发生额及余额表"
  93.          BeginProperty Font 
  94.             Name            =   "宋体"
  95.             Size            =   14.25
  96.             Charset         =   134
  97.             Weight          =   700
  98.             Underline       =   0   'False
  99.             Italic          =   0   'False
  100.             Strikethrough   =   0   'False
  101.          EndProperty
  102.          ForeColor       =   &H00000000&
  103.          Height          =   285
  104.          Index           =   4
  105.          Left            =   630
  106.          TabIndex        =   3
  107.          Top             =   180
  108.          Width           =   2700
  109.       End
  110.       Begin VB.Label Lab_TitleMess 
  111.          AutoSize        =   -1  'True
  112.          BackStyle       =   0  'Transparent
  113.          Caption         =   "会计期间:"
  114.          Height          =   180
  115.          Index           =   0
  116.          Left            =   1080
  117.          TabIndex        =   2
  118.          Top             =   810
  119.          Width           =   810
  120.       End
  121.    End
  122.    Begin MSComctlLib.Toolbar GsToolbar 
  123.       Height          =   525
  124.       Left            =   9510
  125.       TabIndex        =   0
  126.       Top             =   0
  127.       Width           =   1665
  128.       _ExtentX        =   2937
  129.       _ExtentY        =   926
  130.       ButtonWidth     =   1455
  131.       ButtonHeight    =   926
  132.       AllowCustomize  =   0   'False
  133.       Appearance      =   1
  134.       Style           =   1
  135.       ImageList       =   "ImageList1"
  136.       _Version        =   393216
  137.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  138.          NumButtons      =   2
  139.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  140.             Caption         =   "保存格式"
  141.             Key             =   "bcgs"
  142.             ImageKey        =   "bcgs"
  143.          EndProperty
  144.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  145.             Caption         =   "默认列宽"
  146.             Key             =   "hfmrgs"
  147.             ImageKey        =   "mrlk"
  148.          EndProperty
  149.       EndProperty
  150.    End
  151.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  152.       Height          =   6885
  153.       Left            =   60
  154.       TabIndex        =   4
  155.       Top             =   1740
  156.       Width           =   11715
  157.       _cx             =   5080
  158.       _cy             =   5080
  159.       Appearance      =   1
  160.       BorderStyle     =   1
  161.       Enabled         =   -1  'True
  162.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  163.          Name            =   "宋体"
  164.          Size            =   9
  165.          Charset         =   134
  166.          Weight          =   400
  167.          Underline       =   0   'False
  168.          Italic          =   0   'False
  169.          Strikethrough   =   0   'False
  170.       EndProperty
  171.       MousePointer    =   0
  172.       BackColor       =   16777215
  173.       ForeColor       =   -2147483640
  174.       BackColorFixed  =   12632256
  175.       ForeColorFixed  =   -2147483630
  176.       BackColorSel    =   -2147483635
  177.       ForeColorSel    =   -2147483634
  178.       BackColorBkg    =   -2147483636
  179.       BackColorAlternate=   16777215
  180.       GridColor       =   -2147483633
  181.       GridColorFixed  =   -2147483632
  182.       TreeColor       =   -2147483632
  183.       FloodColor      =   192
  184.       SheetBorder     =   -2147483642
  185.       FocusRect       =   1
  186.       HighLight       =   1
  187.       AllowSelection  =   -1  'True
  188.       AllowBigSelection=   -1  'True
  189.       AllowUserResizing=   0
  190.       SelectionMode   =   0
  191.       GridLines       =   1
  192.       GridLinesFixed  =   2
  193.       GridLineWidth   =   1
  194.       Rows            =   50
  195.       Cols            =   10
  196.       FixedRows       =   1
  197.       FixedCols       =   1
  198.       RowHeightMin    =   0
  199.       RowHeightMax    =   0
  200.       ColWidthMin     =   0
  201.       ColWidthMax     =   0
  202.       ExtendLastCol   =   0   'False
  203.       FormatString    =   ""
  204.       ScrollTrack     =   0   'False
  205.       ScrollBars      =   3
  206.       ScrollTips      =   0   'False
  207.       MergeCells      =   0
  208.       MergeCompare    =   0
  209.       AutoResize      =   -1  'True
  210.       AutoSizeMode    =   0
  211.       AutoSearch      =   0
  212.       AutoSearchDelay =   2
  213.       MultiTotals     =   -1  'True
  214.       SubtotalPosition=   1
  215.       OutlineBar      =   0
  216.       OutlineCol      =   0
  217.       Ellipsis        =   0
  218.       ExplorerBar     =   0
  219.       PicturesOver    =   0   'False
  220.       FillStyle       =   0
  221.       RightToLeft     =   0   'False
  222.       PictureType     =   0
  223.       TabBehavior     =   0
  224.       OwnerDraw       =   0
  225.       Editable        =   0
  226.       ShowComboButton =   1
  227.       WordWrap        =   0   'False
  228.       TextStyle       =   0
  229.       TextStyleFixed  =   0
  230.       OleDragMode     =   0
  231.       OleDropMode     =   0
  232.       DataMode        =   0
  233.       VirtualData     =   -1  'True
  234.       DataMember      =   ""
  235.       ComboSearch     =   3
  236.       AutoSizeMouse   =   -1  'True
  237.       FrozenRows      =   0
  238.       FrozenCols      =   0
  239.       AllowUserFreezing=   0
  240.       BackColorFrozen =   0
  241.       ForeColorFrozen =   0
  242.       WallPaperAlignment=   9
  243.       AccessibleName  =   ""
  244.       AccessibleDescription=   ""
  245.       AccessibleValue =   ""
  246.       AccessibleRole  =   24
  247.    End
  248.    Begin MSComctlLib.Toolbar SzToolbar 
  249.       Align           =   1  'Align Top
  250.       Height          =   555
  251.       Left            =   0
  252.       TabIndex        =   5
  253.       Top             =   0
  254.       Width           =   11190
  255.       _ExtentX        =   19738
  256.       _ExtentY        =   979
  257.       ButtonWidth     =   820
  258.       ButtonHeight    =   926
  259.       AllowCustomize  =   0   'False
  260.       Appearance      =   1
  261.       Style           =   1
  262.       ImageList       =   "ImageList1"
  263.       _Version        =   393216
  264.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  265.          NumButtons      =   15
  266.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  267.             Caption         =   "设置"
  268.             Key             =   "ymsz"
  269.             ImageKey        =   "sz"
  270.          EndProperty
  271.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  272.             Caption         =   "打印"
  273.             Key             =   "dy"
  274.             ImageKey        =   "dy"
  275.          EndProperty
  276.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  277.             Caption         =   "预览"
  278.             Key             =   "yl"
  279.             ImageKey        =   "yl"
  280.          EndProperty
  281.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  282.             Style           =   3
  283.          EndProperty
  284.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  285.             Caption         =   "查询"
  286.             Key             =   "cx"
  287.             ImageKey        =   "cx"
  288.          EndProperty
  289.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  290.             Style           =   3
  291.          EndProperty
  292.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  293.             Caption         =   "累计"
  294.             Key             =   "lj"
  295.             ImageKey        =   "lj"
  296.             Style           =   1
  297.          EndProperty
  298.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  299.             Style           =   3
  300.          EndProperty
  301.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  302.             Caption         =   "总帐"
  303.             Key             =   "zz"
  304.             ImageKey        =   "zz"
  305.          EndProperty
  306.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  307.             Caption         =   "明细"
  308.             Key             =   "mxz"
  309.             ImageKey        =   "mx"
  310.          EndProperty
  311.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  312.             Style           =   3
  313.          EndProperty
  314.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  315.             Caption         =   "刷新"
  316.             Key             =   "sx"
  317.             ImageKey        =   "sx"
  318.          EndProperty
  319.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  320.             Style           =   3
  321.          EndProperty
  322.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  323.             Caption         =   "帮助"
  324.             Key             =   "bz"
  325.             ImageKey        =   "bz"
  326.          EndProperty
  327.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  328.             Caption         =   "退出"
  329.             Key             =   "fh"
  330.             ImageKey        =   "tc"
  331.          EndProperty
  332.       EndProperty
  333.       BorderStyle     =   1
  334.       Begin MSComctlLib.ImageList ImageList1 
  335.          Left            =   5700
  336.          Top             =   0
  337.          _ExtentX        =   1005
  338.          _ExtentY        =   1005
  339.          BackColor       =   -2147483643
  340.          ImageWidth      =   16
  341.          ImageHeight     =   16
  342.          MaskColor       =   12632256
  343.          _Version        =   393216
  344.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  345.             NumListImages   =   35
  346.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  347.                Picture         =   "帐簿_科目余额表查询结果.frx":35106
  348.                Key             =   "sz"
  349.             EndProperty
  350.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  351.                Picture         =   "帐簿_科目余额表查询结果.frx":354A0
  352.                Key             =   "dy"
  353.             EndProperty
  354.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  355.                Picture         =   "帐簿_科目余额表查询结果.frx":3583A
  356.                Key             =   "yl"
  357.             EndProperty
  358.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  359.                Picture         =   "帐簿_科目余额表查询结果.frx":35BD4
  360.                Key             =   "xg"
  361.             EndProperty
  362.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  363.                Picture         =   "帐簿_科目余额表查询结果.frx":35F6E
  364.                Key             =   "zh"
  365.             EndProperty
  366.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  367.                Picture         =   "帐簿_科目余额表查询结果.frx":36308
  368.                Key             =   "sh"
  369.             EndProperty
  370.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  371.                Picture         =   "帐簿_科目余额表查询结果.frx":366A2
  372.                Key             =   "bc"
  373.             EndProperty
  374.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  375.                Picture         =   "帐簿_科目余额表查询结果.frx":36A3C
  376.                Key             =   "fq"
  377.             EndProperty
  378.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  379.                Picture         =   "帐簿_科目余额表查询结果.frx":36DD6
  380.                Key             =   "bz"
  381.             EndProperty
  382.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  383.                Picture         =   "帐簿_科目余额表查询结果.frx":37170
  384.                Key             =   "tc"
  385.             EndProperty
  386.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  387.                Picture         =   "帐簿_科目余额表查询结果.frx":3750A
  388.                Key             =   "bcgs"
  389.             EndProperty
  390.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  391.                Picture         =   "帐簿_科目余额表查询结果.frx":378A4
  392.                Key             =   "mrlk"
  393.             EndProperty
  394.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  395.                Picture         =   "帐簿_科目余额表查询结果.frx":37C3E
  396.                Key             =   "xsxm"
  397.             EndProperty
  398.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  399.                Picture         =   "帐簿_科目余额表查询结果.frx":37FD8
  400.                Key             =   "first"
  401.             EndProperty
  402.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.                Picture         =   "帐簿_科目余额表查询结果.frx":38372
  404.                Key             =   "prev"
  405.             EndProperty
  406.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.                Picture         =   "帐簿_科目余额表查询结果.frx":3870C
  408.                Key             =   "next"
  409.             EndProperty
  410.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.                Picture         =   "帐簿_科目余额表查询结果.frx":38AA6
  412.                Key             =   "last"
  413.             EndProperty
  414.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.                Picture         =   "帐簿_科目余额表查询结果.frx":38E40
  416.                Key             =   "xx"
  417.             EndProperty
  418.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.                Picture         =   "帐簿_科目余额表查询结果.frx":391DA
  420.                Key             =   "define"
  421.             EndProperty
  422.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.                Picture         =   "帐簿_科目余额表查询结果.frx":39574
  424.                Key             =   "exec"
  425.             EndProperty
  426.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.                Picture         =   "帐簿_科目余额表查询结果.frx":3990E
  428.                Key             =   "xz"
  429.             EndProperty
  430.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.                Picture         =   "帐簿_科目余额表查询结果.frx":39CA8
  432.                Key             =   "sc"
  433.             EndProperty
  434.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.                Picture         =   "帐簿_科目余额表查询结果.frx":3A042
  436.                Key             =   "sx"
  437.             EndProperty
  438.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.                Picture         =   "帐簿_科目余额表查询结果.frx":3A3DC
  440.                Key             =   "cx"
  441.             EndProperty
  442.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.                Picture         =   "帐簿_科目余额表查询结果.frx":3A776
  444.                Key             =   "zd"
  445.             EndProperty
  446.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.                Picture         =   "帐簿_科目余额表查询结果.frx":3AB10
  448.                Key             =   "dz"
  449.             EndProperty
  450.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.                Picture         =   "帐簿_科目余额表查询结果.frx":3AEAA
  452.                Key             =   "ph"
  453.             EndProperty
  454.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.                Picture         =   "帐簿_科目余额表查询结果.frx":3B244
  456.                Key             =   "fz"
  457.             EndProperty
  458.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.                Picture         =   "帐簿_科目余额表查询结果.frx":3B5DE
  460.                Key             =   "dw"
  461.             EndProperty
  462.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.                Picture         =   "帐簿_科目余额表查询结果.frx":3B978
  464.                Key             =   "hf"
  465.             EndProperty
  466.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.                Picture         =   "帐簿_科目余额表查询结果.frx":3BD12
  468.                Key             =   "pz"
  469.             EndProperty
  470.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  471.                Picture         =   "帐簿_科目余额表查询结果.frx":3C0AC
  472.                Key             =   "check"
  473.             EndProperty
  474.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  475.                Picture         =   "帐簿_科目余额表查询结果.frx":3C446
  476.                Key             =   "zz"
  477.             EndProperty
  478.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  479.                Picture         =   "帐簿_科目余额表查询结果.frx":3C7E0
  480.                Key             =   "mx"
  481.             EndProperty
  482.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  483.                Picture         =   "帐簿_科目余额表查询结果.frx":3CB7A
  484.                Key             =   "lj"
  485.             EndProperty
  486.          EndProperty
  487.       End
  488.    End
  489. End
  490. Attribute VB_Name = "ZB_FrmKmyebjg"
  491. Attribute VB_GlobalNameSpace = False
  492. Attribute VB_Creatable = False
  493. Attribute VB_PredeclaredId = True
  494. Attribute VB_Exposed = False
  495. '*********************************************************************
  496. '*    模 块 名 称 :科目发生额及余额表
  497. '*    功 能 描 述 :本功能用于查询统计各级科目的本期发生额、累计
  498. '*                 发生额和余额等。余额表则可输出某月或某几个月
  499. '*                 的所有总帐科目或明细科目的期初余额、本期发生
  500. '*                 额、累计发生额、期末余额。并支持包含未记帐凭
  501. '*                 证查询。
  502. '*    程序员姓名  : 张建忠
  503. '*    最后修改人  : 奚俊峰
  504. '*    最后修改时间: 2001-12-29
  505. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  506. '*********************************************************************
  507. '=====================变量声明区=======================================bsj==
  508. Const FIRST_ACC_ADD = 0  '期初相加
  509. Const BEN_QI = 1  '本期相加
  510. Const LEI_JI = 2  '累计相加
  511. Dim iAddState As Integer   '记录集相加标识
  512. Dim temRs As New ADODB.Recordset  '临时
  513. Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  514. Dim iPeriodStar As Integer, iPeriodEnd As Integer '会计期间
  515. Dim sCodeStar As String, sCodeEnd As String  '会计科目代码
  516. Dim iGradeStar As Integer, iGradeEnd As Integer  '科目级次
  517. Dim sClass As String  '科目类型
  518. '===========================================================================
  519. Dim ReportTitle As String                '报表主标题
  520. Dim Bln_ClassSum As Boolean              '是否进行科目类别合计
  521. '以下为固定使用变量
  522. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  523. Dim GridCode As String                   '显示网格网格代码
  524. Dim GridInf() As Variant                 '整个网格设置信息
  525. Dim Tsxx As String                       '系统提示信息
  526. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  527. Dim Sjhgd As Double                      '网格数据行高度
  528. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  529. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  530. Dim GridStr()  As String                 '网格列信息(字符型)
  531. Dim GridInt() As Integer                 '网格列信息(整型)
  532. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  533. Dim Bln_Stop As Boolean                  '停止输出查询结果
  534. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  535.     On Error Resume Next
  536.     With CxbbGrid
  537.         .Width = Me.Width - 160
  538.         .Height = Me.Height - .Top - 400
  539.     End With
  540.     With Pic_Title
  541.         .Width = Me.Width - 160
  542.     End With
  543.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  544. End Sub
  545. Private Sub Form_Load()                  '窗体装入
  546.     '调入打印页面设置窗体
  547.     XtReportCode = "Cwzz_kmyeb"
  548.     Load Dyymctbl
  549.     ReportTitle = "科目余额及发生额表"
  550.     
  551.     '调整标题栏及网格、格式工具条位置
  552.     Pic_Title.Left = 40
  553.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  554.     CxbbGrid.Left = Pic_Title.Left
  555.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  556.     
  557.     '调 入 网 格
  558.     GridCode = "Cwzz_kmyeb"
  559.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  560.     
  561.     Qslz = GridInf(1)
  562.     Sjhgd = GridInf(2)
  563.     Sfxshjwg = GridInf(7)
  564.     Szzls = CxbbGrid.Cols - 1
  565.     
  566.     '帐页格式
  567.     Call FillCombo(Combo_AccFormat, "Cwzz_zygs", "", 0)
  568.     Bln_End = True
  569.     
  570.     '调整标题位置
  571.     SetTitlePos tsLabel(4)
  572.     
  573.     
  574. End Sub
  575. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  576.     '-----------------------
  577.     Set clsAccAss = Nothing
  578.     '------------------------
  579.     '卸载条件窗体
  580.     ZB_Frmkmyebtj.UnloadCheck.Value = 1
  581.     Unload ZB_Frmkmyebtj
  582.     '卸载打印页面设置窗体
  583.     Unload Dyymctbl
  584. End Sub
  585. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  586.     Select Case Button.Key
  587.     Case "bcgs"                                          '保存表格格式
  588.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  589.     Case "hfmrgs"                                        '恢复默认格式
  590.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  591.     Case "szxsxm"                                        '设置显示项目
  592.         Call Szxsxm(CxbbGrid, GridCode)
  593.     End Select
  594. End Sub
  595. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  596.     Select Case Button.Key
  597.     Case "ymsz"                                          '页面设置
  598.         Dyymctbl.Show 1
  599.     Case "yl"                                            '预 览
  600.         Call bbyl(True)
  601.     Case "dy"                                            '打 印
  602.         Call bbyl(False)
  603.     Case "cx"                                            '查 询
  604.         ZB_Frmkmyebtj.Show 1
  605.     Case "lj"                                            '累 计
  606.         Call Combo_AccFormat_Click
  607.     Case "zz"                                            '总 帐
  608.         Call Sub_LcZflz
  609.     Case "mxz"                                           '明细帐
  610.         Call Sub_Lcmxz
  611.     Case "sx"                                            '刷 新
  612.         Call Timer1_Timer
  613.     Case "bz"                                            '帮 助
  614.         Call F1bz
  615.     Case "fh"                                            '退 出
  616.         Unload Me
  617.     End Select
  618. End Sub
  619. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  620.     Timer1.Enabled = False
  621.     
  622.     Xt_Wait.Show
  623.     Xt_Wait.Refresh
  624.     
  625.     '加快显示速度
  626.     CxbbGrid.Redraw = False
  627.     
  628.     '生成查询结果
  629.     Call Sub_Query
  630.     Call Combo_AccFormat_Click
  631.     CxbbGrid.Redraw = True
  632.     Xt_Wait.Hide
  633. End Sub
  634. Private Sub Sub_Query()                                    '生成查询结果
  635.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  636.     Dim Rec_AccSum As New ADODB.Recordset       '科目总帐动态集
  637.     Dim Str_QueryCondi As String                '用户录入查询条件
  638.     Dim Bln_IncluNotBook As Boolean             '是否包含未记帐凭证
  639.     Dim Sqlstr As String                        '查询字符串
  640.     Dim Coljsq As Long                          '网格列计数器
  641.     Dim Jsqte As Long                           '临时动态计数器
  642.     Dim Bln_RemoveEmpty As Boolean              '是否删除空数据行
  643.     Dim Bln_Empty As Boolean                    '此数据行是否为空数据行
  644.     Dim Int_BPeriod As Integer                  '查询起始会计期间
  645.     Dim Int_EPeriod As Integer                  '查询终止会计期间
  646.     Dim Int_Year As Integer                     '查询会计年度
  647.     Dim Str_Ccode As String                     '查询会计科目
  648.     Dim Str_CclassIndex As String               '科目类别索引号
  649.     Dim Lng_ParCol As Long                      '类别科目所在列
  650.     Dim Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#   '期初金额,数量,外币
  651.     Dim Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj# '本期合计(金额,数量,外币)
  652.     Dim Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj# '截止累计(金额,数量,外币)
  653.     Dim Dbl_Qmyete#, Dbl_Qmslte#, Dbl_Qmwbte#   '期末金额,数量,外币
  654.     
  655.     '以下为用户自定义部分[
  656.     With ZB_Frmkmyebtj
  657.         '显示查询会计期间
  658.         Lab_TitleText(0).Caption = .Combo_Kjqj(0).Text & "-" & .Combo_Kjqj(1)
  659.         Int_Year = Int(Mid(.Combo_Kjqj(0).Text, 1, 4))
  660.         Int_BPeriod = Int(Mid(.Combo_Kjqj(0).Text, 6, 2))
  661.         Int_EPeriod = Int(Mid(.Combo_Kjqj(1).Text, 6, 2))
  662.         
  663.         '是否包含未记帐凭证
  664.         If .Chk_NotBook.Value = 1 Then
  665.             Bln_IncluNotBook = True
  666.         Else
  667.             Bln_IncluNotBook = False
  668.         End If
  669.         
  670.         '是否删除空数据行
  671.         If .Chk_NotOuputZero = 1 Then
  672.             Bln_RemoveEmpty = True
  673.         Else
  674.             Bln_RemoveEmpty = False
  675.         End If
  676.         Str_QueryCondi = " where 1=1 "
  677.         For Jsqte = 1 To 4
  678.             Select Case Jsqte
  679.             Case 1   '科目类型
  680.                 If Trim(.Combo_Class.Text) <> "" Then
  681.                     Str_QueryCondi = Str_QueryCondi & " and CClass='" & Trim(.Combo_Class.Text) & "'"
  682.                 End If
  683.             Case 2   '科目号范围(起始科目号)
  684.                 Str_QueryCondi = Str_QueryCondi & " and CCode>='" & Trim(.LrText(0).Text) & "'"
  685.             Case 3   '科目号范围(终止科目号)
  686.                 If Trim(.LrText(1).Text) <> "" Then
  687.                     Str_QueryCondi = Str_QueryCondi & " and CCode<='" & Trim(.LrText(1).Text) & "'"
  688.                 End If
  689.             Case 4   '科目级次范围(起始科目级次-终止科目级次)
  690.                 Str_QueryCondi = Str_QueryCondi & " and Cgrade>=" & Val(.LrText(2).Text) & " and Cgrade<=" & Val(.LrText(3).Text)
  691.                 '只有一级科目查询按科目类别合计才有道理
  692.                 If Val(.LrText(2).Text) = 1 And .Chk_ClassSum.Value = 1 Then
  693.                     Bln_ClassSum = True
  694.                 Else
  695.                     Bln_ClassSum = False
  696.                 End If
  697.             End Select
  698.         Next Jsqte
  699.     End With
  700.     
  701.     '=====================bsj ===================================================
  702.     '由于以上SQL语句在“包含末记帐凭证”查询时迅速太慢,所以在这里生成新的优化查询
  703.     '考虑到此查询算法可能进一步优化,所以保留了调用组件的方法。(即调用DLL,返回记录集)
  704.     '此方法只用于补救在数据量增多时,系统查询迅速变慢。
  705.     '
  706.     '此行为原程序   Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  707.     If WhichWay = True Then
  708.         Dim myDll As Object
  709.         Set myDll = CreateObject("Hxxd.GetRs")
  710.         Set Rec_Query = myDll.Recordset
  711.         Set myDll = Nothing
  712.     Else
  713.         Dim clsAccSum As New AccSum
  714.         With clsAccSum
  715.             .iGrade_Begin = Val(ZB_Frmkmyebtj.LrText(2).Text)
  716.             .iGrade_End = Val(ZB_Frmkmyebtj.LrText(3).Text)
  717.             .sCode_Begin = Trim(ZB_Frmkmyebtj.LrText(0).Text)
  718.             .sCode_End = Trim(ZB_Frmkmyebtj.LrText(1).Text)
  719.             .sClass = Trim(ZB_Frmkmyebtj.Combo_Class.Text)
  720.             .iPeriod_Begin = Int_BPeriod
  721.             .iPeriod_End = Int_EPeriod
  722.             .iPeriod_Year = Int_Year
  723.             .b_Keep_Business_Records = Bln_IncluNotBook
  724.         End With
  725.         Set Rec_Query = clsAccSum.GetNewRs
  726.         '在窗体卸载时会销毁临时记录集
  727.     End If
  728.     '================================bsj end=============================================
  729.     With Rec_Query
  730.         If Not (.EOF And .BOF) Then
  731.             .MoveFirst
  732.         End If
  733.         CxbbGrid.Rows = CxbbGrid.FixedRows
  734.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  735.         Jsqte = CxbbGrid.FixedRows
  736.         Do While Not .EOF
  737.             If Jsqte >= CxbbGrid.Rows Then
  738.             End If
  739.             '初始化各种值
  740.             Bln_Empty = True
  741.             Dbl_Qcyete = IIf(IsNull(Rec_Query.Fields("Qcyehj")), 0, Rec_Query.Fields("Qcyehj"))
  742.             Dbl_Qcslte = IIf(IsNull(Rec_Query.Fields("Qcslhj")), 0, Rec_Query.Fields("Qcslhj"))
  743.             Dbl_Qcwbte = IIf(IsNull(Rec_Query.Fields("Qcwbhj")), 0, Rec_Query.Fields("Qcwbhj"))
  744.             
  745.             Dbl_Jejfhj = IIf(IsNull(Rec_Query.Fields("Mjjehj")), 0, Rec_Query.Fields("Mjjehj"))
  746.             Dbl_Jedfhj = IIf(IsNull(Rec_Query.Fields("Mdjehj")), 0, Rec_Query.Fields("Mdjehj"))
  747.             Dbl_Sljfhj = IIf(IsNull(Rec_Query.Fields("Mjslhj")), 0, Rec_Query.Fields("Mjslhj"))
  748.             Dbl_Sldfhj = IIf(IsNull(Rec_Query.Fields("Mdslhj")), 0, Rec_Query.Fields("Mdslhj"))
  749.             Dbl_Wbjfhj = IIf(IsNull(Rec_Query.Fields("Mjwbhj")), 0, Rec_Query.Fields("Mjwbhj"))
  750.             Dbl_Wbdfhj = IIf(IsNull(Rec_Query.Fields("Mdwbhj")), 0, Rec_Query.Fields("Mdwbhj"))
  751.             
  752.             '[Begin zjz 2001-06-16 修改无累计数据
  753.             Dbl_Jejflj = IIf(IsNull(Rec_Query.Fields("Byjfljjehj")), 0, Rec_Query.Fields("Byjfljjehj"))
  754.             Dbl_Jedflj = IIf(IsNull(Rec_Query.Fields("Bydfljjehj")), 0, Rec_Query.Fields("Bydfljjehj"))
  755.             Dbl_Sljflj = IIf(IsNull(Rec_Query.Fields("Byjfljslhj")), 0, Rec_Query.Fields("Byjfljslhj"))
  756.             Dbl_Sldflj = IIf(IsNull(Rec_Query.Fields("Bydfljslhj")), 0, Rec_Query.Fields("Bydfljslhj"))
  757.             Dbl_Wbjflj = IIf(IsNull(Rec_Query.Fields("Byjfljwbhj")), 0, Rec_Query.Fields("Byjfljwbhj"))
  758.             Dbl_Wbdflj = IIf(IsNull(Rec_Query.Fields("Bydfljwbhj")), 0, Rec_Query.Fields("Bydfljwbhj"))
  759.             'End zjz]
  760.             
  761.             Dbl_Qmyete = Dbl_Qcyete + Dbl_Jejfhj - Dbl_Jedfhj
  762.             Dbl_Qmslte = Dbl_Qcslte + Dbl_Sljfhj - Dbl_Sldfhj
  763.             Dbl_Qmwbte = Dbl_Qcwbte + Dbl_Wbjfhj - Dbl_Wbdfhj
  764.             
  765.             Str_Ccode = Trim(.Fields("Ccode"))
  766.             Str_CclassIndex = Trim(.Fields("Item_Index")) & ""
  767.             
  768.             '添加科目类别和科目编码(目的为了排序)
  769.             CxbbGrid.TextMatrix(Jsqte, 0) = Str_CclassIndex + Str_Ccode
  770.             CxbbGrid.TextMatrix(Jsqte, 1) = Str_CclassIndex
  771.             CxbbGrid.TextMatrix(Jsqte, 2) = .Fields("CodeLevel")
  772.             
  773.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Ccode"))              '科目编码
  774.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Cname") & "")         '科目名称
  775.             
  776.             '将期初数据写入网格
  777.             If Dbl_Qcyete = 0 Then
  778.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "平"     '期初方向
  779.                 If Rec_Query.Fields("EndFlag") And Dbl_Qcslte <> 0 Then
  780.                     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Qcslte
  781.                 End If
  782.                 If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") And Dbl_Qcwbte <> 0 Then
  783.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Qcwbte
  784.                 End If
  785.             Else
  786.                 If Dbl_Qcyete > 0 Then
  787.                     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "借"
  788.                     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Dbl_Qcyete
  789.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Qcyete
  790.                     If Rec_Query.Fields("EndFlag") And Dbl_Qcslte <> 0 Then
  791.                         CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Qcslte
  792.                     End If
  793.                     If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") And Dbl_Qcwbte <> 0 Then
  794.                         CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Qcwbte
  795.                     End If
  796.                 Else
  797.                     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "贷"
  798.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = -Dbl_Qcyete
  799.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = -Dbl_Qcyete
  800.                     If Rec_Query.Fields("EndFlag") And Dbl_Qcslte <> 0 Then
  801.                         CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = -Dbl_Qcslte
  802.                     End If
  803.                     If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") And Dbl_Qcwbte <> 0 Then
  804.                         CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = -Dbl_Qcwbte
  805.                     End If
  806.                 End If
  807.             End If
  808.             '将期间合计数据写入网格
  809.             If Dbl_Jejfhj <> 0 Then
  810.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj       '本期发生.借方
  811.                 CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Dbl_Jejfhj       '本期借方发生.金额
  812.             End If
  813.             If Dbl_Jedfhj <> 0 Then
  814.                 CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj       '本期发生.贷方
  815.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Dbl_Jedfhj       '本期贷方发生.金额
  816.             End If
  817.             '仅有末级科目才显示数量,外币
  818.             If Rec_Query.Fields("EndFlag") Then
  819.                 If Dbl_Sljfhj <> 0 Then
  820.                     CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Sljfhj   '本期借方发生.数量
  821.                 End If
  822.                 If Dbl_Sldfhj <> 0 Then
  823.                     CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Dbl_Sldfhj   '本期贷方发生.数量
  824.                 End If
  825.             End If
  826.             If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") Then
  827.                 If Dbl_Wbjfhj <> 0 Then
  828.                     CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Wbjfhj   '本期借方发生.外币
  829.                 End If
  830.                 If Dbl_Wbdfhj <> 0 Then
  831.                     CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Wbdfhj   '本期贷方发生.外币
  832.                 End If
  833.             End If
  834.             '将截止累计数据写入网格
  835.             If Dbl_Jejflj <> 0 Then
  836.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Dbl_Jejflj       '累计发生.借方
  837.                 CxbbGrid.TextMatrix(Jsqte, Sydz("021", GridStr(), Szzls)) = Dbl_Jejflj       '累计借方发生.金额
  838.             End If
  839.             If Dbl_Jedflj <> 0 Then
  840.                 CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Dbl_Jedflj       '累计发生.贷方
  841.                 CxbbGrid.TextMatrix(Jsqte, Sydz("024", GridStr(), Szzls)) = Dbl_Jedflj       '累计贷方发生.金额
  842.             End If
  843.             '仅有末级科目才显示数量,外币
  844.             If Rec_Query.Fields("EndFlag") Then
  845.                 If Dbl_Sljflj <> 0 Then
  846.                     CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Dbl_Sljflj   '累计借方发生.数量
  847.                 End If
  848.                 If Dbl_Sldflj <> 0 Then
  849.                     CxbbGrid.TextMatrix(Jsqte, Sydz("022", GridStr(), Szzls)) = Dbl_Sldflj   '累计贷方发生.数量
  850.                 End If
  851.             End If
  852.             If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") Then
  853.                 If Dbl_Wbjflj <> 0 Then
  854.                     CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = Dbl_Wbjflj   '累计借方发生.外币
  855.                 End If
  856.                 If Dbl_Wbdflj <> 0 Then
  857.                     CxbbGrid.TextMatrix(Jsqte, Sydz("023", GridStr(), Szzls)) = Dbl_Wbdflj   '累计贷方发生.外币
  858.                 End If
  859.             End If
  860.             '将期末数据写入网格
  861.             If Dbl_Qmyete = 0 Then
  862.                 CxbbGrid.TextMatrix(Jsqte, Sydz("025", GridStr(), Szzls)) = "平"     '期初方向
  863.                 If Rec_Query.Fields("EndFlag") And Dbl_Qmslte <> 0 Then
  864.                     CxbbGrid.TextMatrix(Jsqte, Sydz("028", GridStr(), Szzls)) = Dbl_Qmslte
  865.                 End If
  866.                 If Rec_Query.Fields("EndFlag") And Dbl_Qmwbte <> 0 Then
  867.                     CxbbGrid.TextMatrix(Jsqte, Sydz("029", GridStr(), Szzls)) = Dbl_Qmwbte
  868.                 End If
  869.             Else
  870.                 If Dbl_Qmyete > 0 Then
  871.                     CxbbGrid.TextMatrix(Jsqte, Sydz("025", GridStr(), Szzls)) = "借"
  872.                     CxbbGrid.TextMatrix(Jsqte, Sydz("026", GridStr(), Szzls)) = Dbl_Qmyete
  873.                     CxbbGrid.TextMatrix(Jsqte, Sydz("030", GridStr(), Szzls)) = Dbl_Qmyete
  874.                     If Rec_Query.Fields("EndFlag") And Dbl_Qmslte <> 0 Then
  875.                         CxbbGrid.TextMatrix(Jsqte, Sydz("028", GridStr(), Szzls)) = Dbl_Qmslte
  876.                     End If
  877.                     If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") And Dbl_Qmwbte <> 0 Then
  878.                         CxbbGrid.TextMatrix(Jsqte, Sydz("029", GridStr(), Szzls)) = Dbl_Qmwbte
  879.                     End If
  880.                 Else
  881.                     CxbbGrid.TextMatrix(Jsqte, Sydz("025", GridStr(), Szzls)) = "贷"
  882.                     CxbbGrid.TextMatrix(Jsqte, Sydz("027", GridStr(), Szzls)) = -Dbl_Qmyete
  883.                     CxbbGrid.TextMatrix(Jsqte, Sydz("030", GridStr(), Szzls)) = -Dbl_Qmyete
  884.                     If Rec_Query.Fields("EndFlag") And Dbl_Qmslte <> 0 Then
  885.                         CxbbGrid.TextMatrix(Jsqte, Sydz("028", GridStr(), Szzls)) = -Dbl_Qmslte
  886.                     End If
  887.                     If Rec_Query.Fields("EndFlag") And Rec_Query.Fields("ForeignFlag") And Dbl_Qmwbte <> 0 Then
  888.                         CxbbGrid.TextMatrix(Jsqte, Sydz("029", GridStr(), Szzls)) = -Dbl_Qmwbte
  889.                     End If
  890.                 End If
  891.             End If
  892.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  893.             '如果用户要求删除为零数据
  894.             If Bln_RemoveEmpty Then
  895.                 If Dbl_Qcyete <> 0 Or Dbl_Qcslte <> 0 Or Dbl_Qcwbte <> 0 Then
  896.                     Bln_Empty = False
  897.                 End If
  898.                 If Dbl_Jejfhj <> 0 Or Dbl_Jedfhj <> 0 Or Dbl_Sljfhj <> 0 Or Dbl_Sldfhj <> 0 Or Dbl_Wbjfhj <> 0 Or Dbl_Wbdfhj <> 0 Then
  899.                     Bln_Empty = False
  900.                 End If
  901.                 If Dbl_Jejflj <> 0 Or Dbl_Jedflj <> 0 Or Dbl_Sljflj <> 0 Or Dbl_Sldflj <> 0 Or Dbl_Wbjflj <> 0 Or Dbl_Wbdflj <> 0 Then
  902.                     Bln_Empty = False
  903.                 End If
  904.             Else
  905.                 Bln_Empty = False
  906.             End If
  907.             If Bln_Empty Then
  908.                 CxbbGrid.RemoveItem Jsqte
  909.             Else
  910.                 Jsqte = Jsqte + 1
  911.             End If
  912.             '移动到下一条记录
  913.             .MoveNext
  914.         Loop
  915.     End With
  916.     
  917.     '将网格按科目类别+编码排序
  918.     With CxbbGrid
  919.         .Col = 0
  920.         .Sort = flexSortStringAscending
  921.     End With
  922.     
  923.     '判断是否进行科目类别合计
  924.     If Bln_ClassSum Then
  925.         Call Sub_ClassSum
  926.     End If
  927. End Sub
  928. Private Sub Sub_ClassSum()                             '按科目类别汇总数据
  929.     Dim Rowjsq As Long                          '临时网格计数器
  930.     Dim Dbl_Qcjfye#, Dbl_Qcdfye#                '期初金额(借贷合计)
  931.     Dim Dbl_Jejfhj#, Dbl_Jedfhj#                '本期合计(金额)
  932.     Dim Dbl_Jejflj#, Dbl_Jedflj#                '截止累计(金额)
  933.     Dim Dbl_Qmjfye#, Dbl_Qmdfye#                '期末金额(借贷合计)
  934.     Dim Dbl_Qcyete#                             '期初余额
  935.     Dim Dbl_Qmyete#                             '期末余额
  936.     Dim Str_ClassIndex As String                '科目类别索引号
  937.     
  938.     Bln_ClassSum = False
  939.     With CxbbGrid
  940.         Str_ClassIndex = ""
  941.         If .Rows > .FixedRows Then
  942.             Str_ClassIndex = Trim(CxbbGrid.TextMatrix(.FixedRows, 1))
  943.         End If
  944.         Rowjsq = .FixedRows
  945.         Do While Rowjsq <= .Rows - 1
  946.             '仅累加一级科目
  947.             If Val(CxbbGrid.TextMatrix(Rowjsq, 2)) = 1 And Str_ClassIndex = Trim(CxbbGrid.TextMatrix(Rowjsq, 1)) Then
  948.                 Dbl_Qcjfye = Dbl_Qcjfye + Val(.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)))
  949.                 Dbl_Qcdfye = Dbl_Qcdfye + Val(.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)))
  950.                 Dbl_Jejfhj = Dbl_Jejfhj + Val(.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)))
  951.                 Dbl_Jedfhj = Dbl_Jedfhj + Val(.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)))
  952.                 Dbl_Jejflj = Dbl_Jejflj + Val(.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)))
  953.                 Dbl_Jedflj = Dbl_Jedflj + Val(.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)))
  954.                 Dbl_Qmjfye = Dbl_Qmjfye + Val(.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)))
  955.                 Dbl_Qmdfye = Dbl_Qmdfye + Val(.TextMatrix(Rowjsq, Sydz("026", GridStr(), Szzls)))
  956.             End If
  957.             If Str_ClassIndex <> Trim(CxbbGrid.TextMatrix(Rowjsq, 1)) Then
  958.                 CxbbGrid.AddItem "", Rowjsq
  959.                 CxbbGrid.RowHeight(Rowjsq) = Sjhgd
  960.                 CxbbGrid.TextMatrix(Rowjsq, 0) = Str_ClassIndex + "合计"
  961.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Fun_GetContent("Cwzz_kmlx", Str_ClassIndex) + "类合计"
  962.                 CxbbGrid.Cell(flexcpBackColor, Rowjsq, 0, , CxbbGrid.Cols - 1) = Lab_Color(0).BackColor
  963.                 '显示数据
  964.                 '1.显示期初余额
  965.                 Dbl_Qcyete = Dbl_Qcjfye - Dbl_Qcdfye
  966.                 If Dbl_Qcyete = 0 Then
  967.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "平"     '期初方向
  968.                 Else
  969.                     If Dbl_Qcyete > 0 Then
  970.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "借"
  971.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Dbl_Qcyete
  972.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Dbl_Qcyete
  973.                     Else
  974.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "贷"
  975.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = -Dbl_Qcyete
  976.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = -Dbl_Qcyete
  977.                     End If
  978.                 End If
  979.                 '2.显示期间合计数据
  980.                 If Dbl_Jejfhj <> 0 Then
  981.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj       '本期发生.借方
  982.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("013", GridStr(), Szzls)) = Dbl_Jejfhj       '本期借方发生.金额
  983.                 End If
  984.                 If Dbl_Jedfhj <> 0 Then
  985.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj       '本期发生.贷方
  986.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), Szzls)) = Dbl_Jedfhj       '本期贷方发生.金额
  987.                 End If
  988.                 '3.显示截止累计借贷方发生额
  989.                 If Dbl_Jejflj <> 0 Then
  990.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)) = Dbl_Jejflj       '累计发生.借方
  991.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("021", GridStr(), Szzls)) = Dbl_Jejflj       '累计借方发生.金额
  992.                 End If
  993.                 If Dbl_Jedflj <> 0 Then
  994.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)) = Dbl_Jedflj       '累计发生.贷方
  995.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("024", GridStr(), Szzls)) = Dbl_Jedflj       '累计贷方发生.金额
  996.                 End If
  997.                 '4.计算本期期末余额
  998.                 Dbl_Qmyete = Dbl_Qcyete + Dbl_Jejfhj - Dbl_Jedfhj
  999.                 If Dbl_Qmyete = 0 Then
  1000.                     CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "平"     '期初方向
  1001.                 Else
  1002.                     If Dbl_Qmyete > 0 Then
  1003.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "借"
  1004.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("026", GridStr(), Szzls)) = Dbl_Qmyete
  1005.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("030", GridStr(), Szzls)) = Dbl_Qmyete
  1006.                     Else
  1007.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "贷"
  1008.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("027", GridStr(), Szzls)) = -Dbl_Qmyete
  1009.                         CxbbGrid.TextMatrix(Rowjsq, Sydz("030", GridStr(), Szzls)) = -Dbl_Qmyete
  1010.                     End If
  1011.                 End If
  1012.                 Rowjsq = Rowjsq + 1
  1013.                 Str_ClassIndex = Trim(CxbbGrid.TextMatrix(Rowjsq, 1))
  1014.                 Dbl_Qcjfye = Val(.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)))
  1015.                 Dbl_Qcdfye = Val(.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)))
  1016.                 Dbl_Jejfhj = Val(.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)))
  1017.                 Dbl_Jedfhj = Val(.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)))
  1018.                 Dbl_Jejflj = Val(.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)))
  1019.                 Dbl_Jedflj = Val(.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)))
  1020.                 Dbl_Qmjfye = Val(.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)))
  1021.                 Dbl_Qmdfye = Val(.TextMatrix(Rowjsq, Sydz("026", GridStr(), Szzls)))
  1022.                 '显示完毕
  1023.             End If
  1024.             Rowjsq = Rowjsq + 1
  1025.         Loop
  1026.         '无数据行则不添加合计
  1027.         If .FixedRows = .Rows Then
  1028.             Exit Sub
  1029.         End If
  1030.         CxbbGrid.AddItem "", Rowjsq
  1031.         CxbbGrid.RowHeight(Rowjsq) = Sjhgd
  1032.         CxbbGrid.TextMatrix(Rowjsq, 0) = Str_ClassIndex + "合计"
  1033.         CxbbGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Fun_GetContent("Cwzz_kmlx", Str_ClassIndex) + "类合计"
  1034.         CxbbGrid.Cell(flexcpBackColor, Rowjsq, 0, , CxbbGrid.Cols - 1) = Lab_Color(0).BackColor
  1035.         '显示数据
  1036.         '1.显示期初余额
  1037.         Dbl_Qcyete = Dbl_Qcjfye - Dbl_Qcdfye
  1038.         If Dbl_Qcyete = 0 Then
  1039.             CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "平"     '期初方向
  1040.         Else
  1041.             If Dbl_Qcyete > 0 Then
  1042.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "借"
  1043.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Dbl_Qcyete
  1044.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Dbl_Qcyete
  1045.             Else
  1046.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "贷"
  1047.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = -Dbl_Qcyete
  1048.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = -Dbl_Qcyete
  1049.             End If
  1050.         End If
  1051.         '2.显示期间合计数据
  1052.         If Dbl_Jejfhj <> 0 Then
  1053.             CxbbGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj       '本期发生.借方
  1054.             CxbbGrid.TextMatrix(Rowjsq, Sydz("013", GridStr(), Szzls)) = Dbl_Jejfhj       '本期借方发生.金额
  1055.         End If
  1056.         If Dbl_Jedfhj <> 0 Then
  1057.             CxbbGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj       '本期发生.贷方
  1058.             CxbbGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), Szzls)) = Dbl_Jedfhj       '本期贷方发生.金额
  1059.         End If
  1060.         '3.显示截止累计借贷方发生额
  1061.         If Dbl_Jejflj <> 0 Then
  1062.             CxbbGrid.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)) = Dbl_Jejflj       '累计发生.借方
  1063.             CxbbGrid.TextMatrix(Rowjsq, Sydz("021", GridStr(), Szzls)) = Dbl_Jejflj       '累计借方发生.金额
  1064.         End If
  1065.         If Dbl_Jedflj <> 0 Then
  1066.             CxbbGrid.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)) = Dbl_Jedflj       '累计发生.贷方
  1067.             CxbbGrid.TextMatrix(Rowjsq, Sydz("024", GridStr(), Szzls)) = Dbl_Jedflj       '累计贷方发生.金额
  1068.         End If
  1069.         '4.计算本期期末余额
  1070.         Dbl_Qmyete = Dbl_Qcyete + Dbl_Jejfhj - Dbl_Jedfhj
  1071.         If Dbl_Qmyete = 0 Then
  1072.             CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "平"     '期初方向
  1073.         Else
  1074.             If Dbl_Qmyete > 0 Then
  1075.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "借"
  1076.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("026", GridStr(), Szzls)) = Dbl_Qmyete
  1077.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("030", GridStr(), Szzls)) = Dbl_Qmyete
  1078.             Else
  1079.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("025", GridStr(), Szzls)) = "贷"
  1080.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("027", GridStr(), Szzls)) = -Dbl_Qmyete
  1081.                 CxbbGrid.TextMatrix(Rowjsq, Sydz("030", GridStr(), Szzls)) = -Dbl_Qmyete
  1082.             End If
  1083.         End If
  1084.     End With
  1085. End Sub
  1086. Private Sub Combo_AccFormat_Click()                    '用户选择不同帐页格式
  1087.     Dim Int_Coljsq As Integer         '网格列临时计数器
  1088.     '为了加快显示速度
  1089.     CxbbGrid.Redraw = False
  1090.     For Int_Coljsq = Qslz To CxbbGrid.Cols - 1
  1091.         CxbbGrid.ColHidden(Int_Coljsq) = True
  1092.     Next Int_Coljsq
  1093.     Select Case Combo_AccFormat
  1094.     Case "金额式"
  1095.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '科目编码
  1096.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '科目名称
  1097.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '期初余额.借方
  1098.         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False      '期初余额.贷方
  1099.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '本期发生.借方
  1100.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '本期发生.贷方
  1101.         If SzToolbar.Buttons("lj").Value = tbrPressed Then
  1102.             CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '累计发生.借方
  1103.             CxbbGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False      '累计发生.贷方
  1104.         End If
  1105.         CxbbGrid.ColHidden(Sydz("026", GridStr(), Szzls)) = False      '期末余额.借方
  1106.         CxbbGrid.ColHidden(Sydz("027", GridStr(), Szzls)) = False      '期末余额.贷方
  1107.     Case "外币金额式"
  1108.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '科目编码
  1109.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '科目名称
  1110.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '方向.方向
  1111.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '期初余额.外币
  1112.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '期初余额.金额
  1113.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '本期借方发生.外币
  1114.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '本期借方发生.金额
  1115.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '本期贷方发生.外币
  1116.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '本期贷方发生.金额
  1117.         If SzToolbar.Buttons("lj").Value = tbrPressed Then
  1118.             CxbbGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False      '累计借方发生.外币
  1119.             CxbbGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False      '累计借方发生.金额
  1120.             CxbbGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False      '累计贷方发生.外币
  1121.             CxbbGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False      '累计贷方发生.金额
  1122.         End If
  1123.         CxbbGrid.ColHidden(Sydz("025", GridStr(), Szzls)) = False      '方向.方向
  1124.         CxbbGrid.ColHidden(Sydz("029", GridStr(), Szzls)) = False      '期末余额.外币
  1125.         CxbbGrid.ColHidden(Sydz("030", GridStr(), Szzls)) = False      '期末余额.金额
  1126.     Case "数量金额式"
  1127.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '科目编码
  1128.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '科目名称
  1129.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '方向.方向
  1130.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '期初余额.数量
  1131.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '期初余额.金额
  1132.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '本期借方发生.数量
  1133.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '本期借方发生.金额
  1134.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '本期贷方发生.数量
  1135.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '本期贷方发生.金额
  1136.         If SzToolbar.Buttons("lj").Value = tbrPressed Then
  1137.             CxbbGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False      '累计借方发生.数量
  1138.             CxbbGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False      '累计借方发生.金额
  1139.             CxbbGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False      '累计贷方发生.数量
  1140.             CxbbGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False      '累计贷方发生.金额
  1141.         End If
  1142.         CxbbGrid.ColHidden(Sydz("025", GridStr(), Szzls)) = False      '方向.方向
  1143.         CxbbGrid.ColHidden(Sydz("028", GridStr(), Szzls)) = False      '期末余额.数量
  1144.         CxbbGrid.ColHidden(Sydz("030", GridStr(), Szzls)) = False      '期末余额.金额
  1145.     Case "数量外币式"
  1146.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '科目编码
  1147.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '科目名称
  1148.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '方向.方向
  1149.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '期初余额.数量
  1150.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '期初余额.外币
  1151.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '期初余额.金额
  1152.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '本期借方发生.数量
  1153.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '本期借方发生.外币
  1154.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '本期借方发生.金额
  1155.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '本期贷方发生.数量
  1156.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '本期贷方发生.外币
  1157.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '本期贷方发生.金额
  1158.         If SzToolbar.Buttons("lj").Value = tbrPressed Then
  1159.             CxbbGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False      '累计借方发生.数量
  1160.             CxbbGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False      '累计借方发生.外币
  1161.             CxbbGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False      '累计借方发生.金额
  1162.             CxbbGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False      '累计贷方发生.数量
  1163.             CxbbGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False      '累计贷方发生.外币
  1164.             CxbbGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False      '累计贷方发生.金额
  1165.         End If
  1166.         CxbbGrid.ColHidden(Sydz("025", GridStr(), Szzls)) = False      '方向.方向
  1167.         CxbbGrid.ColHidden(Sydz("028", GridStr(), Szzls)) = False      '期末余额.数量
  1168.         CxbbGrid.ColHidden(Sydz("029", GridStr(), Szzls)) = False      '期末余额.外币
  1169.         CxbbGrid.ColHidden(Sydz("030", GridStr(), Szzls)) = False      '期末余额.金额
  1170.     End Select
  1171.     CxbbGrid.Redraw = True
  1172. End Sub
  1173. Private Sub Sub_LcZflz()                               '联查总分类帐
  1174.     '非数据行退出
  1175.     If CxbbGrid.Row < CxbbGrid.FixedRows Then
  1176.         Exit Sub
  1177.     End If
  1178.     '联查总分类帐
  1179.     If Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, Sydz("001", GridStr(), Szzls))) <> "" Then
  1180.         ZB_Frmzflztj.LrText(0).Text = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, Sydz("001", GridStr(), Szzls)))   '查询科目
  1181.         ZB_Frmzflztj.LrText(3).Text = 6
  1182.         ZB_Frmzflztj.Chk_NotBook.Value = ZB_Frmkmyebtj.Chk_NotBook.Value                                       '是否包含未记帐凭证
  1183.         ZB_Frmzflzjg.Timer1.Enabled = True                                                                     '激活查询总分类帐过程
  1184.         ZB_Frmzflzjg.Show
  1185.         ZB_Frmzflzjg.SetFocus
  1186.     End If
  1187. End Sub
  1188. Private Sub Sub_Lcmxz()                                '联查科目明细帐
  1189.     '非数据行退出
  1190.     If CxbbGrid.Row < CxbbGrid.FixedRows Then
  1191.         Exit Sub
  1192.     End If
  1193.     '联查明细帐
  1194.     If Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, Sydz("001", GridStr(), Szzls))) <> "" Then
  1195.         ZB_Frmkmmxztj.Combo_Kjqj(0).Text = ZB_Frmkmyebtj.Combo_Kjqj(0).Text   '起始会计期间
  1196.         ZB_Frmkmmxztj.Combo_Kjqj(1).Text = ZB_Frmkmyebtj.Combo_Kjqj(1).Text   '终止会计期间
  1197.         ZB_Frmkmmxztj.LrText(0).Text = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, Sydz("001", GridStr(), Szzls)))        '查询科目
  1198.         ZB_Frmkmmxztj.Chk_NotBook.Value = ZB_Frmkmyebtj.Chk_NotBook.Value     '是否包含未记帐凭证
  1199.         ZB_Frmkmmxzjg.Timer1.Enabled = True                                   '激活查询明细帐过程
  1200.         ZB_Frmkmmxzjg.Show
  1201.         ZB_Frmkmmxzjg.SetFocus
  1202.     End If
  1203. End Sub
  1204. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1205.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1206.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1207.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1208.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1209.     ReDim Bbxbt(1 To Bbxbtgs)
  1210.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1211.     If Bbbwhgs <> 0 Then
  1212.         ReDim Bbbwh(1 To Bbbwhgs)
  1213.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1214.     End If
  1215.     Bbzbt = ReportTitle
  1216.     Bbxbt(1) = Space(2) + "会计期间:" + Lab_TitleText(0)
  1217.     bbxbtzzxs(1) = 0                                    '报表行组织形式(0-居左 1-居中 2-居右)
  1218.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1219.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1220.     If Not bbylte Then
  1221.         Unload DY_Tybbyldy
  1222.     End If
  1223. End Sub