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

企业管理

开发平台:

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