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