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

企业管理

开发平台:

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