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

企业管理

开发平台:

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 JC_FrmQcyeDz 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "期初录入对帐"
  7.    ClientHeight    =   7545
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   11355
  11.    HelpContextID   =   112001
  12.    Icon            =   "基础设置_期初录入对帐.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   7545
  17.    ScaleWidth      =   11355
  18.    StartUpPosition =   1  '所有者中心
  19.    Begin VB.PictureBox Pic_Title 
  20.       Height          =   1395
  21.       Left            =   0
  22.       Picture         =   "基础设置_期初录入对帐.frx":1042
  23.       ScaleHeight     =   1335
  24.       ScaleWidth      =   11715
  25.       TabIndex        =   3
  26.       Top             =   600
  27.       Width           =   11775
  28.       Begin MSComctlLib.ImageList ImageList1 
  29.          Left            =   10620
  30.          Top             =   360
  31.          _ExtentX        =   1005
  32.          _ExtentY        =   1005
  33.          BackColor       =   -2147483643
  34.          ImageWidth      =   16
  35.          ImageHeight     =   16
  36.          MaskColor       =   12632256
  37.          _Version        =   393216
  38.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  39.             NumListImages   =   26
  40.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  41.                Picture         =   "基础设置_期初录入对帐.frx":35106
  42.                Key             =   "sz"
  43.             EndProperty
  44.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  45.                Picture         =   "基础设置_期初录入对帐.frx":354A0
  46.                Key             =   "dy"
  47.             EndProperty
  48.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  49.                Picture         =   "基础设置_期初录入对帐.frx":3583A
  50.                Key             =   "yl"
  51.             EndProperty
  52.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  53.                Picture         =   "基础设置_期初录入对帐.frx":35BD4
  54.                Key             =   "xg"
  55.             EndProperty
  56.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  57.                Picture         =   "基础设置_期初录入对帐.frx":35F6E
  58.                Key             =   "zh"
  59.             EndProperty
  60.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  61.                Picture         =   "基础设置_期初录入对帐.frx":36308
  62.                Key             =   "sh"
  63.             EndProperty
  64.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.                Picture         =   "基础设置_期初录入对帐.frx":366A2
  66.                Key             =   "bc"
  67.             EndProperty
  68.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  69.                Picture         =   "基础设置_期初录入对帐.frx":36A3C
  70.                Key             =   "fq"
  71.             EndProperty
  72.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  73.                Picture         =   "基础设置_期初录入对帐.frx":36DD6
  74.                Key             =   "bz"
  75.             EndProperty
  76.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  77.                Picture         =   "基础设置_期初录入对帐.frx":37170
  78.                Key             =   "tc"
  79.             EndProperty
  80.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  81.                Picture         =   "基础设置_期初录入对帐.frx":3750A
  82.                Key             =   "bcgs"
  83.             EndProperty
  84.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  85.                Picture         =   "基础设置_期初录入对帐.frx":378A4
  86.                Key             =   "mrlk"
  87.             EndProperty
  88.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  89.                Picture         =   "基础设置_期初录入对帐.frx":37C3E
  90.                Key             =   "xsxm"
  91.             EndProperty
  92.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  93.                Picture         =   "基础设置_期初录入对帐.frx":37FD8
  94.                Key             =   "first"
  95.             EndProperty
  96.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  97.                Picture         =   "基础设置_期初录入对帐.frx":38372
  98.                Key             =   "prev"
  99.             EndProperty
  100.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.                Picture         =   "基础设置_期初录入对帐.frx":3870C
  102.                Key             =   "next"
  103.             EndProperty
  104.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.                Picture         =   "基础设置_期初录入对帐.frx":38AA6
  106.                Key             =   "last"
  107.             EndProperty
  108.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.                Picture         =   "基础设置_期初录入对帐.frx":38E40
  110.                Key             =   "xx"
  111.             EndProperty
  112.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.                Picture         =   "基础设置_期初录入对帐.frx":391DA
  114.                Key             =   "define"
  115.             EndProperty
  116.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.                Picture         =   "基础设置_期初录入对帐.frx":39574
  118.                Key             =   "exec"
  119.             EndProperty
  120.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.                Picture         =   "基础设置_期初录入对帐.frx":3990E
  122.                Key             =   "xz"
  123.             EndProperty
  124.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  125.                Picture         =   "基础设置_期初录入对帐.frx":39CA8
  126.                Key             =   "sc"
  127.             EndProperty
  128.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  129.                Picture         =   "基础设置_期初录入对帐.frx":3A042
  130.                Key             =   "sx"
  131.             EndProperty
  132.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  133.                Picture         =   "基础设置_期初录入对帐.frx":3A3DC
  134.                Key             =   "cx"
  135.             EndProperty
  136.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  137.                Picture         =   "基础设置_期初录入对帐.frx":3A776
  138.                Key             =   "zd"
  139.             EndProperty
  140.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  141.                Picture         =   "基础设置_期初录入对帐.frx":3AB10
  142.                Key             =   "dz"
  143.             EndProperty
  144.          EndProperty
  145.       End
  146.       Begin VB.Label Label1 
  147.          BackStyle       =   0  'Transparent
  148.          Caption         =   "正在核对科目:"
  149.          Height          =   195
  150.          Left            =   6180
  151.          TabIndex        =   19
  152.          Top             =   330
  153.          Width           =   1365
  154.       End
  155.       Begin VB.Label Lab_Check1 
  156.          BackStyle       =   0  'Transparent
  157.          Caption         =   "核对总帐上下级"
  158.          Height          =   285
  159.          Index           =   0
  160.          Left            =   3570
  161.          TabIndex        =   18
  162.          Top             =   810
  163.          Width           =   1455
  164.       End
  165.       Begin VB.Label Lab_Check1 
  166.          BackStyle       =   0  'Transparent
  167.          Caption         =   "核对总帐与部门帐"
  168.          Height          =   285
  169.          Index           =   1
  170.          Left            =   6180
  171.          TabIndex        =   17
  172.          Top             =   810
  173.          Width           =   1455
  174.       End
  175.       Begin VB.Label Lab_Check1 
  176.          BackStyle       =   0  'Transparent
  177.          Caption         =   "核对总帐与客户往来帐"
  178.          Height          =   285
  179.          Index           =   2
  180.          Left            =   8700
  181.          TabIndex        =   16
  182.          Top             =   810
  183.          Width           =   1905
  184.       End
  185.       Begin VB.Label Lab_Check1 
  186.          BackStyle       =   0  'Transparent
  187.          Caption         =   "核对总帐与供应商往来帐"
  188.          Height          =   285
  189.          Index           =   3
  190.          Left            =   3570
  191.          TabIndex        =   15
  192.          Top             =   1110
  193.          Width           =   2115
  194.       End
  195.       Begin VB.Label Lab_Check1 
  196.          BackStyle       =   0  'Transparent
  197.          Caption         =   "核对总帐与个人往来帐"
  198.          Height          =   285
  199.          Index           =   4
  200.          Left            =   6180
  201.          TabIndex        =   14
  202.          Top             =   1110
  203.          Width           =   1905
  204.       End
  205.       Begin VB.Label Lab_Check1 
  206.          BackStyle       =   0  'Transparent
  207.          Caption         =   "核对总帐与项目帐"
  208.          Height          =   285
  209.          Index           =   5
  210.          Left            =   8700
  211.          TabIndex        =   13
  212.          Top             =   1110
  213.          Width           =   1905
  214.       End
  215.       Begin VB.Label Lab_CheckJg 
  216.          BackStyle       =   0  'Transparent
  217.          Caption         =   "√"
  218.          ForeColor       =   &H000000FF&
  219.          Height          =   285
  220.          Index           =   0
  221.          Left            =   3270
  222.          TabIndex        =   12
  223.          Top             =   810
  224.          Visible         =   0   'False
  225.          Width           =   285
  226.       End
  227.       Begin VB.Label Lab_CheckJg 
  228.          BackStyle       =   0  'Transparent
  229.          Caption         =   "√"
  230.          ForeColor       =   &H000000FF&
  231.          Height          =   285
  232.          Index           =   1
  233.          Left            =   5880
  234.          TabIndex        =   11
  235.          Top             =   810
  236.          Visible         =   0   'False
  237.          Width           =   285
  238.       End
  239.       Begin VB.Label Lab_CheckJg 
  240.          BackStyle       =   0  'Transparent
  241.          Caption         =   "√"
  242.          ForeColor       =   &H000000FF&
  243.          Height          =   285
  244.          Index           =   2
  245.          Left            =   8400
  246.          TabIndex        =   10
  247.          Top             =   810
  248.          Visible         =   0   'False
  249.          Width           =   285
  250.       End
  251.       Begin VB.Label Lab_CheckJg 
  252.          BackStyle       =   0  'Transparent
  253.          Caption         =   "√"
  254.          ForeColor       =   &H000000FF&
  255.          Height          =   285
  256.          Index           =   3
  257.          Left            =   3270
  258.          TabIndex        =   9
  259.          Top             =   1110
  260.          Visible         =   0   'False
  261.          Width           =   285
  262.       End
  263.       Begin VB.Label Lab_CheckJg 
  264.          BackStyle       =   0  'Transparent
  265.          Caption         =   "√"
  266.          ForeColor       =   &H000000FF&
  267.          Height          =   285
  268.          Index           =   4
  269.          Left            =   5880
  270.          TabIndex        =   8
  271.          Top             =   1110
  272.          Visible         =   0   'False
  273.          Width           =   285
  274.       End
  275.       Begin VB.Label Lab_CheckJg 
  276.          BackStyle       =   0  'Transparent
  277.          Caption         =   "√"
  278.          ForeColor       =   &H000000FF&
  279.          Height          =   285
  280.          Index           =   5
  281.          Left            =   8400
  282.          TabIndex        =   7
  283.          Top             =   1110
  284.          Visible         =   0   'False
  285.          Width           =   285
  286.       End
  287.       Begin VB.Label Lab_Ccode 
  288.          BackStyle       =   0  'Transparent
  289.          ForeColor       =   &H00000000&
  290.          Height          =   255
  291.          Left            =   7470
  292.          TabIndex        =   6
  293.          Top             =   330
  294.          Width           =   4065
  295.       End
  296.       Begin VB.Label Label2 
  297.          BackStyle       =   0  'Transparent
  298.          Caption         =   "(下面为对帐错误记录列表)"
  299.          ForeColor       =   &H00000000&
  300.          Height          =   255
  301.          Left            =   750
  302.          TabIndex        =   5
  303.          Top             =   960
  304.          Width           =   2445
  305.       End
  306.       Begin VB.Label tsLabel 
  307.          BackColor       =   &H80000018&
  308.          BackStyle       =   0  'Transparent
  309.          Caption         =   "帐目核对"
  310.          BeginProperty Font 
  311.             Name            =   "宋体"
  312.             Size            =   14.25
  313.             Charset         =   134
  314.             Weight          =   700
  315.             Underline       =   0   'False
  316.             Italic          =   0   'False
  317.             Strikethrough   =   0   'False
  318.          EndProperty
  319.          ForeColor       =   &H00000000&
  320.          Height          =   375
  321.          Index           =   4
  322.          Left            =   510
  323.          TabIndex        =   4
  324.          Top             =   180
  325.          Width           =   1395
  326.       End
  327.    End
  328.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  329.       Height          =   5445
  330.       Left            =   0
  331.       TabIndex        =   0
  332.       Top             =   2040
  333.       Width           =   11325
  334.       _cx             =   5080
  335.       _cy             =   5080
  336.       Appearance      =   1
  337.       BorderStyle     =   1
  338.       Enabled         =   -1  'True
  339.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  340.          Name            =   "宋体"
  341.          Size            =   9
  342.          Charset         =   134
  343.          Weight          =   400
  344.          Underline       =   0   'False
  345.          Italic          =   0   'False
  346.          Strikethrough   =   0   'False
  347.       EndProperty
  348.       MousePointer    =   0
  349.       BackColor       =   16777215
  350.       ForeColor       =   -2147483640
  351.       BackColorFixed  =   12632256
  352.       ForeColorFixed  =   -2147483630
  353.       BackColorSel    =   -2147483635
  354.       ForeColorSel    =   -2147483634
  355.       BackColorBkg    =   -2147483636
  356.       BackColorAlternate=   16777215
  357.       GridColor       =   -2147483633
  358.       GridColorFixed  =   -2147483632
  359.       TreeColor       =   -2147483632
  360.       FloodColor      =   192
  361.       SheetBorder     =   -2147483642
  362.       FocusRect       =   1
  363.       HighLight       =   1
  364.       AllowSelection  =   -1  'True
  365.       AllowBigSelection=   -1  'True
  366.       AllowUserResizing=   0
  367.       SelectionMode   =   0
  368.       GridLines       =   1
  369.       GridLinesFixed  =   2
  370.       GridLineWidth   =   1
  371.       Rows            =   50
  372.       Cols            =   10
  373.       FixedRows       =   1
  374.       FixedCols       =   1
  375.       RowHeightMin    =   0
  376.       RowHeightMax    =   0
  377.       ColWidthMin     =   0
  378.       ColWidthMax     =   0
  379.       ExtendLastCol   =   0   'False
  380.       FormatString    =   ""
  381.       ScrollTrack     =   0   'False
  382.       ScrollBars      =   3
  383.       ScrollTips      =   0   'False
  384.       MergeCells      =   0
  385.       MergeCompare    =   0
  386.       AutoResize      =   -1  'True
  387.       AutoSizeMode    =   0
  388.       AutoSearch      =   0
  389.       AutoSearchDelay =   2
  390.       MultiTotals     =   -1  'True
  391.       SubtotalPosition=   1
  392.       OutlineBar      =   0
  393.       OutlineCol      =   0
  394.       Ellipsis        =   0
  395.       ExplorerBar     =   0
  396.       PicturesOver    =   0   'False
  397.       FillStyle       =   0
  398.       RightToLeft     =   0   'False
  399.       PictureType     =   0
  400.       TabBehavior     =   0
  401.       OwnerDraw       =   0
  402.       Editable        =   0
  403.       ShowComboButton =   1
  404.       WordWrap        =   0   'False
  405.       TextStyle       =   0
  406.       TextStyleFixed  =   0
  407.       OleDragMode     =   0
  408.       OleDropMode     =   0
  409.       DataMode        =   0
  410.       VirtualData     =   -1  'True
  411.       DataMember      =   ""
  412.       ComboSearch     =   3
  413.       AutoSizeMouse   =   -1  'True
  414.       FrozenRows      =   0
  415.       FrozenCols      =   0
  416.       AllowUserFreezing=   0
  417.       BackColorFrozen =   0
  418.       ForeColorFrozen =   0
  419.       WallPaperAlignment=   9
  420.       AccessibleName  =   ""
  421.       AccessibleDescription=   ""
  422.       AccessibleValue =   ""
  423.       AccessibleRole  =   24
  424.    End
  425.    Begin MSComctlLib.Toolbar Tlb_Action 
  426.       Align           =   1  'Align Top
  427.       Height          =   555
  428.       Left            =   0
  429.       TabIndex        =   1
  430.       Top             =   0
  431.       Width           =   11355
  432.       _ExtentX        =   20029
  433.       _ExtentY        =   979
  434.       ButtonWidth     =   820
  435.       ButtonHeight    =   926
  436.       AllowCustomize  =   0   'False
  437.       Wrappable       =   0   'False
  438.       Appearance      =   1
  439.       Style           =   1
  440.       ImageList       =   "ImageList1"
  441.       _Version        =   393216
  442.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  443.          NumButtons      =   8
  444.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  445.             Caption         =   "设置"
  446.             Key             =   "ymsz"
  447.             Object.ToolTipText     =   "打印页面设置"
  448.             ImageKey        =   "sz"
  449.          EndProperty
  450.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  451.             Caption         =   "打印"
  452.             Key             =   "dy"
  453.             Object.ToolTipText     =   "打印当前单据或Ctrl+P"
  454.             ImageKey        =   "dy"
  455.          EndProperty
  456.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  457.             Caption         =   "预览"
  458.             Key             =   "yl"
  459.             ImageKey        =   "yl"
  460.          EndProperty
  461.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  462.             Style           =   3
  463.          EndProperty
  464.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  465.             Caption         =   "对帐"
  466.             Key             =   "dz"
  467.             ImageKey        =   "dz"
  468.          EndProperty
  469.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  470.             Style           =   3
  471.          EndProperty
  472.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  473.             Caption         =   "帮助"
  474.             Key             =   "bz"
  475.             ImageKey        =   "bz"
  476.          EndProperty
  477.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  478.             Caption         =   "退出"
  479.             Key             =   "fh"
  480.             ImageKey        =   "tc"
  481.          EndProperty
  482.       EndProperty
  483.       BorderStyle     =   1
  484.       Begin MSComctlLib.Toolbar GsToolbar 
  485.          Height          =   525
  486.          Left            =   8850
  487.          TabIndex        =   2
  488.          Top             =   0
  489.          Width           =   2475
  490.          _ExtentX        =   4366
  491.          _ExtentY        =   926
  492.          ButtonWidth     =   1455
  493.          ButtonHeight    =   926
  494.          AllowCustomize  =   0   'False
  495.          Appearance      =   1
  496.          Style           =   1
  497.          ImageList       =   "ImageList1"
  498.          _Version        =   393216
  499.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  500.             NumButtons      =   3
  501.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  502.                Caption         =   "保存格式"
  503.                Key             =   "bcgs"
  504.                ImageKey        =   "bcgs"
  505.             EndProperty
  506.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  507.                Caption         =   "默认列宽"
  508.                Key             =   "hfmrgs"
  509.                ImageKey        =   "mrlk"
  510.             EndProperty
  511.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  512.                Caption         =   "显示项目"
  513.                Key             =   "szxsxm"
  514.                ImageKey        =   "xsxm"
  515.             EndProperty
  516.          EndProperty
  517.       End
  518.    End
  519. End
  520. Attribute VB_Name = "JC_FrmQcyeDz"
  521. Attribute VB_GlobalNameSpace = False
  522. Attribute VB_Creatable = False
  523. Attribute VB_PredeclaredId = True
  524. Attribute VB_Exposed = False
  525. '**************************************************************************
  526. '*    模 块 名 称 :期初余额录入帐目核对
  527. '*    功 能 描 述 :核对总帐上下级科目,总帐与部门帐
  528. '*                 总帐与客户往来帐,总帐与供应商往来帐,总帐与个人往来帐
  529. '*                 总帐与项目帐是否平衡(包括年初余额,期初余额,月借方发生额
  530. '*                 月贷方发生额,年累计借方发生额,年累计贷方发生额,期末余额)
  531. '*    程序员姓名  :张建忠
  532. '*    最后修改人  :张建忠
  533. '*    最后修改时间:2001/11/26
  534. '*    备        注:
  535. '**************************************************************************
  536. Dim Int_CheckYear As Integer             '核对帐目会计年度
  537. Dim Int_CheckPeriod As Integer           '核对帐目会计期间
  538. Dim ReportTitle As String                '报表主标题
  539. '以下为固定使用变量
  540. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  541. Dim GridCode As String                   '显示网格网格代码
  542. Dim GridInf() As Variant                 '整个网格设置信息
  543. Dim Tsxx As String                       '系统提示信息
  544. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  545. Dim Sjhgd As Double                      '网格数据行高度
  546. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  547. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  548. Dim GridStr()  As String                 '网格列信息(字符型)
  549. Dim GridInt() As Integer                 '网格列信息(整型)
  550. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  551. Private Sub Form_Load()
  552.     
  553.     '对帐会计年度和会计期间
  554.     Int_CheckYear = Val(Xtcdcs)
  555.     Int_CheckPeriod = Val(Xtcdcsfz)
  556.     
  557.     '调入打印页面设置窗体
  558.     
  559.     XtReportCode = "Cwzz_qcyelrdz"
  560.     Load Dyymctbl
  561.     ReportTitle = "帐目对帐结果"
  562.     
  563.     '调 入 网 格
  564.     GridCode = "Cwzz_qcyelrdz"
  565.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  566.     
  567.     Qslz = GridInf(1)
  568.     Sjhgd = GridInf(2)
  569.     Sfxshjwg = GridInf(7)
  570.     Szzls = CxbbGrid.Cols - 1
  571.     
  572.     '调整标题位置
  573.     SetTitlePos tsLabel(4)
  574.     
  575. End Sub
  576. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  577.     
  578.     Select Case Button.Key
  579.     Case "bcgs"                                       '保存表格格式
  580.         Call Bcwggs(CxbbGrid, GridCode, GridStr())
  581.     Case "hfmrgs"                                     '恢复默认格式
  582.         Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  583.     Case "szxsxm"                                     '设置显示项目
  584.         Call Szxsxm(CxbbGrid, GridCode)
  585.     End Select
  586.     
  587. End Sub
  588. Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)
  589.     Select Case Button.Key
  590.     Case "ymsz"                                          '页面设置
  591.         Dyymctbl.Show 1
  592.     Case "yl"                                            '预 览
  593.         Call bbyl(True)
  594.     Case "dy"                                            '打 印
  595.         Call bbyl(False)
  596.     Case "dz"                                            '对 帐
  597.         Call Sub_AccCheck
  598.     Case "bz"                                            '帮 助
  599.         Call F1bz
  600.     Case "fh"                                            '退 出
  601.         Unload Me
  602.     End Select
  603. End Sub
  604. Private Sub Sub_AccCheck()                                                                  '帐目核对
  605.     Dim Int_CheckSele As Integer
  606.     
  607.     '初始化对帐结果显示
  608.     CxbbGrid.Rows = CxbbGrid.FixedRows
  609.     CxbbGrid.Refresh
  610.     For Jsqte = 0 To 5
  611.         Lab_CheckJg(Jsqte).Visible = False
  612.         Lab_Check1(Jsqte).ForeColor = &H80000012
  613.     Next Jsqte
  614.     If Fun_Hdsxjkm Then
  615.         Lab_CheckJg(0).Visible = True
  616.     End If
  617.     For Int_CheckSele = 1 To 5
  618.         If Fun_HdZzFzz(Int_CheckSele) Then
  619.             Lab_CheckJg(Int_CheckSele).Visible = True
  620.         End If
  621.     Next Int_CheckSele
  622.     
  623.     Lab_Ccode = ""
  624. End Sub
  625. Private Function Fun_HdZzFzz(Int_CheckSele As Integer) As Boolean                                                    '核对总帐与辅助帐(客户)是否平衡
  626.     
  627.     '1-部门 2-客户 3-供应商 4-个人 5-项目
  628.     
  629.     Dim RecTemp As New ADODB.Recordset                   '临时使用动态集
  630.     Dim Rec_AccSum As New ADODB.Recordset                '科目总帐动态集
  631.     Dim Sqlstr As String                                 '临时查询字符串
  632.     Dim Int_NotCheck As Integer                          '未能核对通过科目个数
  633.     
  634.     Lab_Check1(Int_CheckSele).ForeColor = &HFF&
  635.     Int_NotCheck = 0
  636.     
  637.     Select Case Int_CheckSele
  638.     Case 1
  639.         Sqlstr = "SELECT Cwzz_AccCode.Ccode, Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  640.         " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  641.         " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  642.         " Where Cwzz_AccCode.DeptFlag=1 And Cwzz_AccCode.EndFlag=1"
  643.     Case 2
  644.         Sqlstr = "SELECT Cwzz_AccCode.Ccode, Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  645.         " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  646.         " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  647.         " Where Cwzz_AccCode.CusFlag=1 And Cwzz_AccCode.EndFlag=1"
  648.     Case 3
  649.         Sqlstr = "SELECT Cwzz_AccCode.Ccode, Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  650.         " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  651.         " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  652.         " Where Cwzz_AccCode.SupplierFlag=1 And Cwzz_AccCode.EndFlag=1"
  653.     Case 4
  654.         Sqlstr = "SELECT Cwzz_AccCode.Ccode, Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  655.         " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  656.         " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  657.         " Where Cwzz_AccCode.PersonFlag=1 And Cwzz_AccCode.EndFlag=1"
  658.     Case 5
  659.         Sqlstr = "SELECT Cwzz_AccCode.Ccode,Cwzz_AccCode.ItemClassCode,Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  660.         " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  661.         " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  662.         " Where Cwzz_AccCode.ItemFlag=1 And Cwzz_AccCode.EndFlag=1"
  663.     End Select
  664.     Set Rec_AccSum = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  665.     With Rec_AccSum
  666.         Do While Not .EOF
  667.             Lab_Ccode.Caption = Trim(.Fields("Ccode"))
  668.             Lab_Ccode.Refresh
  669.             
  670.             Sqlstr = "SELECT YcyeHj=IsNull(SUM(Ycye),0), QcyeHj=Isnull(SUM(Qcye),0),MjjeHj=Isnull(SUM(Mjje),0), MdjeHj=Isnull(SUM(Mdje),0)," & _
  671.             " ByjfljjeHj=IsNull(SUM(Byjfljje),0), BydfljjeHj=IsNull(SUM(Bydfljje),0),Qmyehj=IsNull(SUM(Qmye),0)" & _
  672.             " FROM Cwzz_AccSumAssi " & _
  673.             " WHERE Cwzz_AccSumAssi.Ccode ='" & Trim(.Fields("Ccode")) & "' AND Year = " & Int_CheckYear & " AND Period =" & Int_CheckPeriod
  674.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  675.             If Not RecTemp.EOF Then
  676.                 If .Fields("Ycye") <> RecTemp.Fields("YcyeHj") Or .Fields("Qcye") <> RecTemp.Fields("Qcyehj") Or .Fields("Mjje") <> RecTemp.Fields("MjjeHj") Or .Fields("Mdje") <> RecTemp.Fields("MdjeHj") Or .Fields("Byjfljje") <> RecTemp.Fields("Byjfljjehj") Or .Fields("Bydfljje") <> RecTemp.Fields("Bydfljjehj") Or .Fields("Qmye") <> RecTemp.Fields("Qmyehj") Then
  677.                     Int_NotCheck = Int_NotCheck + 1
  678.                     '填充记录错误列表
  679.                     Call Sub_AddRec(Trim(.Fields("Ccode")), "总帐", .Fields("Ycye"), .Fields("Qcye"), .Fields("Mjje"), .Fields("Mdje"), .Fields("Byjfljje"), .Fields("Bydfljje"), .Fields("Qmye"))
  680.                     Select Case Int_CheckSele
  681.                     Case 1
  682.                         Call Sub_AddRec(Trim(.Fields("Ccode")), "部门帐", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  683.                     Case 2
  684.                         Call Sub_AddRec(Trim(.Fields("Ccode")), "客户帐", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  685.                     Case 3
  686.                         Call Sub_AddRec(Trim(.Fields("Ccode")), "供应商帐", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  687.                     Case 4
  688.                         Call Sub_AddRec(Trim(.Fields("Ccode")), "个人帐", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  689.                     Case 5
  690.                         Call Sub_AddRec(Trim(.Fields("Ccode")), "项目帐", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  691.                     End Select
  692.                 End If
  693.             End If
  694.             
  695.             .MoveNext
  696.         Loop
  697.     End With
  698.     If Int_NotCheck <> 0 Then
  699.         Fun_HdZzFzz = False
  700.     Else
  701.         Fun_HdZzFzz = True
  702.         Lab_Check1(Int_CheckSele).ForeColor = &H80000012
  703.     End If
  704. End Function
  705. Private Function Fun_Hdsxjkm() As Boolean                                                   '核对总帐上下级科目是否平衡
  706.     Dim RecTemp As New ADODB.Recordset                   '临时使用动态集
  707.     Dim Rec_AccSum As New ADODB.Recordset                '科目总帐动态集
  708.     Dim Sqlstr As String                                 '临时查询字符串
  709.     Dim Int_NotCheck As Integer                          '未能核对通过科目个数
  710.     
  711.     Lab_Check1(Int_CheckSele).ForeColor = &HFF&
  712.     Int_NotCheck = 0
  713.     
  714.     Sqlstr = "SELECT Cwzz_AccCode.Ccode, Ycye=ISNULL(Ycye,0), Qcye=IsNULL(Qcye,0), Mjje=ISNULL(Mjje,0), Mdje=ISNULL(Mdje,0), Byjfljje=ISNULL(Byjfljje,0), Bydfljje=ISNULL(Bydfljje,0), Qmye=ISNULL(Qmye,0)" & _
  715.     " FROM  Cwzz_AccCode LEFT OUTER JOIN Cwzz_AccSum ON" & _
  716.     " Cwzz_AccCode.Ccode = Cwzz_AccSum.Ccode And Cwzz_AccSum.Year = " & Int_CheckYear & " And Period =" & Int_CheckPeriod & _
  717.     " Where Cwzz_AccCode.EndFlag=0"
  718.     Set Rec_AccSum = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  719.     With Rec_AccSum
  720.         Do While Not .EOF
  721.             Lab_Ccode.Caption = Trim(.Fields("Ccode"))
  722.             Lab_Ccode.Refresh
  723.             
  724.             Sqlstr = "SELECT SUM(Ycye) AS YcyeHj, SUM(Qcye) AS QcyeHj, SUM(Mjje) AS MjjeHj, SUM(Mdje) AS MdjeHj," & _
  725.             " SUM(Byjfljje) AS ByjfljjeHj, SUM(Bydfljje) AS BydfljjeHj, SUM(Qmye) AS Qmyehj" & _
  726.             " FROM Cwzz_AccSum LEFT OUTER JOIN Cwzz_AccCode ON Cwzz_AccSum.Ccode = Cwzz_AccCode.Ccode" & _
  727.             " WHERE Cwzz_AccSum.Ccode LIKE '" & Trim(.Fields("Ccode")) & "%' AND Year = " & Int_CheckYear & " AND Period =" & Int_CheckPeriod & " AND Cwzz_AccCode.EndFlag = 1"
  728.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  729.             If Not RecTemp.EOF Then
  730.                 If .Fields("Ycye") <> RecTemp.Fields("YcyeHj") Or .Fields("Qcye") <> RecTemp.Fields("Qcyehj") Or .Fields("Mjje") <> RecTemp.Fields("MjjeHj") Or .Fields("Mdje") <> RecTemp.Fields("MdjeHj") Or .Fields("Byjfljje") <> RecTemp.Fields("Byjfljjehj") Or .Fields("Bydfljje") <> RecTemp.Fields("Bydfljjehj") Or .Fields("Qmye") <> RecTemp.Fields("Qmyehj") Then
  731.                     Int_NotCheck = Int_NotCheck + 1
  732.                     
  733.                     '填充记录错误列表
  734.                     Call Sub_AddRec(Trim(.Fields("Ccode")), "总帐上级", .Fields("Ycye"), .Fields("Qcye"), .Fields("Mjje"), .Fields("Mdje"), .Fields("Byjfljje"), .Fields("Bydfljje"), .Fields("Qmye"))
  735.                     Call Sub_AddRec(Trim(.Fields("Ccode")), "总帐下级", RecTemp.Fields("Ycyehj"), RecTemp.Fields("Qcyehj"), RecTemp.Fields("Mjjehj"), RecTemp.Fields("Mdjehj"), RecTemp.Fields("Byjfljjehj"), RecTemp.Fields("Bydfljjehj"), RecTemp.Fields("Qmyehj"))
  736.                     
  737.                 End If
  738.             Else
  739.                 If .Fields("Ycye") <> 0 Or .Fields("Qcye") <> 0 Or .Fields("Mjje") <> 0 Or .Fields("Mdje") <> 0 Or .Fields("Byjfljje") <> 0 Or .Fields("Bydfljje") <> 0 Or .Fields("Qmye") <> 0 Then
  740.                     '填充记录错误列表
  741.                     Call Sub_AddRec(Trim(.Fields("Ccode")), "总帐上级", .Fields("Ycye"), .Fields("Qcye"), .Fields("Mjje"), .Fields("Mdje"), .Fields("Byjfljje"), .Fields("Bydfljje"), .Fields("Qmye"))
  742.                     Call Sub_AddRec(Trim(.Fields("Ccode")), "总帐下级", 0, 0, 0, 0, 0, 0, 0)
  743.                 End If
  744.             End If
  745.             .MoveNext
  746.         Loop
  747.     End With
  748.     If Int_NotCheck <> 0 Then
  749.         Fun_Hdsxjkm = False
  750.     Else
  751.         Fun_Hdsxjkm = True
  752.         Lab_Check1(Int_CheckSele).ForeColor = &H80000012
  753.     End If
  754. End Function
  755. Private Sub Sub_AddRec(Str_Ccode As String, CheckItem As String, Ycye#, Qcye#, Mjje#, Mdje#, Byjfljje#, Bydfljje#, Qmye#)            '填充对帐错误记录
  756.     '函数参数说明:科目编码,核对项目,年初余额,期初余额,本期借方发生,本期贷方发生,本年累计借方发生,本年累计贷方发生,期末余额
  757.     
  758.     Dim RecTemp As New ADODB.Recordset                   '临时使用动态集
  759.     Dim Sqlstr As String                                 '临时查询字符串
  760.     Sqlstr = "SELECT Cwzz_AccCode.CName,BalanceOri From Cwzz_AccCode Where CCode='" & Str_Ccode & "'"
  761.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  762.     With CxbbGrid
  763.         .AddItem ""
  764.         .RowHeight(.Rows - 1) = Sjhgd
  765.         .TextMatrix(.Rows - 1, Sydz("001", GridStr(), Szzls)) = Str_Ccode                                   '科目编码
  766.         If Not RecTemp.EOF Then
  767.             .TextMatrix(.Rows - 1, Sydz("002", GridStr(), Szzls)) = Trim(RecTemp.Fields("Cname") & "")       '科目名称
  768.         End If
  769.         .TextMatrix(.Rows - 1, Sydz("003", GridStr(), Szzls)) = CheckItem                                   '核对项目
  770.         If Not RecTemp.EOF Then
  771.             .TextMatrix(.Rows - 1, Sydz("004", GridStr(), Szzls)) = Trim(RecTemp.Fields("BalanceOri"))       '余额方向
  772.         End If
  773.         If Ycye <> 0 Then                                                                                   '年初余额
  774.             If .TextMatrix(.Rows - 1, Sydz("004", GridStr(), Szzls)) = "借" Then
  775.                 .TextMatrix(.Rows - 1, Sydz("005", GridStr(), Szzls)) = Ycye
  776.             Else
  777.                 .TextMatrix(.Rows - 1, Sydz("005", GridStr(), Szzls)) = -Ycye
  778.             End If
  779.         End If
  780.         If Qcye <> 0 Then                                                                                   '期初余额
  781.             If .TextMatrix(.Rows - 1, Sydz("004", GridStr(), Szzls)) = "借" Then
  782.                 .TextMatrix(.Rows - 1, Sydz("006", GridStr(), Szzls)) = Qcye
  783.             Else
  784.                 .TextMatrix(.Rows - 1, Sydz("006", GridStr(), Szzls)) = -Qcye
  785.             End If
  786.         End If
  787.         If Mjje <> 0 Then                                                                                   '本期借方发生
  788.             .TextMatrix(.Rows - 1, Sydz("007", GridStr(), Szzls)) = Mjje
  789.         End If
  790.         If Mdje <> 0 Then                                                                                   '本期贷方发生
  791.             .TextMatrix(.Rows - 1, Sydz("008", GridStr(), Szzls)) = Mdje
  792.         End If
  793.         If Byjfljje <> 0 Then                                                                               '本年借方累计发生
  794.             .TextMatrix(.Rows - 1, Sydz("009", GridStr(), Szzls)) = Byjfljje
  795.         End If
  796.         If Bydfljje <> 0 Then                                                                               '本年贷方累计发生
  797.             .TextMatrix(.Rows - 1, Sydz("010", GridStr(), Szzls)) = Bydfljje
  798.         End If
  799.         If Qmye <> 0 Then                                                                                   '期末余额
  800.             If .TextMatrix(.Rows - 1, Sydz("004", GridStr(), Szzls)) = "借" Then
  801.                 .TextMatrix(.Rows - 1, Sydz("011", GridStr(), Szzls)) = Qmye
  802.             Else
  803.                 .TextMatrix(.Rows - 1, Sydz("011", GridStr(), Szzls)) = -Qmye
  804.             End If
  805.         End If
  806.     End With
  807. End Sub
  808. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  809.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  810.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  811.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  812.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  813.     ReDim Bbxbt(1 To Bbxbtgs)
  814.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  815.     If Bbbwhgs <> 0 Then
  816.         ReDim Bbbwh(1 To Bbbwhgs)
  817.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  818.     End If
  819.     Bbzbt = ReportTitle
  820.     Bbxbt(1) = " "
  821.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  822.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  823.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  824.     If Not bbylte Then
  825.         Unload DY_Tybbyldy
  826.     End If
  827. End Sub