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

企业管理

开发平台:

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 Book_CheckList 
  5.    Caption         =   "固定资产总帐查询"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   11715
  10.    HelpContextID   =   505004
  11.    Icon            =   "固定资产总帐.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11715
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.PictureBox Pic_Title 
  19.       BackColor       =   &H00FFFFFF&
  20.       Height          =   1065
  21.       Left            =   0
  22.       Picture         =   "固定资产总帐.frx":1042
  23.       ScaleHeight     =   1005
  24.       ScaleWidth      =   11655
  25.       TabIndex        =   3
  26.       Top             =   600
  27.       Width           =   11715
  28.       Begin VB.Label tsLabel 
  29.          AutoSize        =   -1  'True
  30.          BackColor       =   &H80000018&
  31.          BackStyle       =   0  'Transparent
  32.          Caption         =   "固定资产总帐"
  33.          BeginProperty Font 
  34.             Name            =   "宋体"
  35.             Size            =   12
  36.             Charset         =   134
  37.             Weight          =   700
  38.             Underline       =   0   'False
  39.             Italic          =   0   'False
  40.             Strikethrough   =   0   'False
  41.          EndProperty
  42.          ForeColor       =   &H00000000&
  43.          Height          =   240
  44.          Index           =   4
  45.          Left            =   525
  46.          TabIndex        =   10
  47.          Top             =   270
  48.          Width           =   1530
  49.       End
  50.       Begin VB.Label Lab_TitleMess 
  51.          BackStyle       =   0  'Transparent
  52.          Caption         =   "会计年度:"
  53.          Height          =   225
  54.          Index           =   0
  55.          Left            =   855
  56.          TabIndex        =   9
  57.          Top             =   735
  58.          Width           =   915
  59.       End
  60.       Begin VB.Label Lab_TitleText 
  61.          AutoSize        =   -1  'True
  62.          BackStyle       =   0  'Transparent
  63.          ForeColor       =   &H00000000&
  64.          Height          =   180
  65.          Index           =   0
  66.          Left            =   1800
  67.          TabIndex        =   8
  68.          Top             =   735
  69.          Width           =   90
  70.       End
  71.       Begin VB.Label Lab_TitleText 
  72.          AutoSize        =   -1  'True
  73.          BackStyle       =   0  'Transparent
  74.          ForeColor       =   &H00000000&
  75.          Height          =   180
  76.          Index           =   1
  77.          Left            =   5160
  78.          TabIndex        =   7
  79.          Top             =   735
  80.          Width           =   90
  81.       End
  82.       Begin VB.Label Lab_TitleMess 
  83.          BackStyle       =   0  'Transparent
  84.          Caption         =   "资产类别:"
  85.          Height          =   225
  86.          Index           =   1
  87.          Left            =   4200
  88.          TabIndex        =   6
  89.          Top             =   735
  90.          Width           =   915
  91.       End
  92.       Begin VB.Label Lab_TitleMess 
  93.          BackStyle       =   0  'Transparent
  94.          Caption         =   "所属部门:"
  95.          Height          =   225
  96.          Index           =   2
  97.          Left            =   7080
  98.          TabIndex        =   5
  99.          Top             =   735
  100.          Width           =   915
  101.       End
  102.       Begin VB.Label Lab_TitleText 
  103.          AutoSize        =   -1  'True
  104.          BackStyle       =   0  'Transparent
  105.          ForeColor       =   &H00000000&
  106.          Height          =   180
  107.          Index           =   2
  108.          Left            =   8040
  109.          TabIndex        =   4
  110.          Top             =   735
  111.          Width           =   90
  112.       End
  113.    End
  114.    Begin VB.Timer Timer1 
  115.       Enabled         =   0   'False
  116.       Interval        =   1
  117.       Left            =   7620
  118.       Top             =   90
  119.    End
  120.    Begin MSComctlLib.Toolbar GsToolbar 
  121.       Height          =   525
  122.       Left            =   9240
  123.       TabIndex        =   0
  124.       Top             =   30
  125.       Width           =   2475
  126.       _ExtentX        =   4366
  127.       _ExtentY        =   926
  128.       ButtonWidth     =   1455
  129.       ButtonHeight    =   926
  130.       AllowCustomize  =   0   'False
  131.       Appearance      =   1
  132.       Style           =   1
  133.       ImageList       =   "ImageList1"
  134.       _Version        =   393216
  135.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  136.          NumButtons      =   3
  137.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  138.             Caption         =   "保存格式"
  139.             Key             =   "bcgs"
  140.             ImageKey        =   "bcgs"
  141.          EndProperty
  142.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  143.             Caption         =   "默认列宽"
  144.             Key             =   "hfmrgs"
  145.             ImageKey        =   "mrlk"
  146.          EndProperty
  147.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  148.             Caption         =   "显示项目"
  149.             Key             =   "szxsxm"
  150.             ImageKey        =   "xmsz"
  151.          EndProperty
  152.       EndProperty
  153.    End
  154.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  155.       Height          =   6975
  156.       Left            =   30
  157.       TabIndex        =   1
  158.       Top             =   1710
  159.       Width           =   11715
  160.       _cx             =   5080
  161.       _cy             =   5080
  162.       Appearance      =   1
  163.       BorderStyle     =   1
  164.       Enabled         =   -1  'True
  165.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  166.          Name            =   "宋体"
  167.          Size            =   9
  168.          Charset         =   134
  169.          Weight          =   400
  170.          Underline       =   0   'False
  171.          Italic          =   0   'False
  172.          Strikethrough   =   0   'False
  173.       EndProperty
  174.       MousePointer    =   0
  175.       BackColor       =   16777215
  176.       ForeColor       =   -2147483640
  177.       BackColorFixed  =   -2147483648
  178.       ForeColorFixed  =   -2147483630
  179.       BackColorSel    =   -2147483635
  180.       ForeColorSel    =   -2147483634
  181.       BackColorBkg    =   -2147483636
  182.       BackColorAlternate=   16777215
  183.       GridColor       =   -2147483633
  184.       GridColorFixed  =   -2147483648
  185.       TreeColor       =   -2147483632
  186.       FloodColor      =   192
  187.       SheetBorder     =   -2147483642
  188.       FocusRect       =   1
  189.       HighLight       =   1
  190.       AllowSelection  =   -1  'True
  191.       AllowBigSelection=   -1  'True
  192.       AllowUserResizing=   0
  193.       SelectionMode   =   0
  194.       GridLines       =   1
  195.       GridLinesFixed  =   2
  196.       GridLineWidth   =   1
  197.       Rows            =   50
  198.       Cols            =   10
  199.       FixedRows       =   1
  200.       FixedCols       =   1
  201.       RowHeightMin    =   0
  202.       RowHeightMax    =   0
  203.       ColWidthMin     =   0
  204.       ColWidthMax     =   0
  205.       ExtendLastCol   =   0   'False
  206.       FormatString    =   ""
  207.       ScrollTrack     =   0   'False
  208.       ScrollBars      =   3
  209.       ScrollTips      =   0   'False
  210.       MergeCells      =   2
  211.       MergeCompare    =   0
  212.       AutoResize      =   -1  'True
  213.       AutoSizeMode    =   0
  214.       AutoSearch      =   0
  215.       AutoSearchDelay =   2
  216.       MultiTotals     =   -1  'True
  217.       SubtotalPosition=   1
  218.       OutlineBar      =   0
  219.       OutlineCol      =   0
  220.       Ellipsis        =   0
  221.       ExplorerBar     =   0
  222.       PicturesOver    =   0   'False
  223.       FillStyle       =   0
  224.       RightToLeft     =   0   'False
  225.       PictureType     =   0
  226.       TabBehavior     =   0
  227.       OwnerDraw       =   0
  228.       Editable        =   0
  229.       ShowComboButton =   1
  230.       WordWrap        =   0   'False
  231.       TextStyle       =   0
  232.       TextStyleFixed  =   0
  233.       OleDragMode     =   0
  234.       OleDropMode     =   0
  235.       DataMode        =   0
  236.       VirtualData     =   -1  'True
  237.       DataMember      =   ""
  238.       ComboSearch     =   3
  239.       AutoSizeMouse   =   -1  'True
  240.       FrozenRows      =   0
  241.       FrozenCols      =   0
  242.       AllowUserFreezing=   0
  243.       BackColorFrozen =   0
  244.       ForeColorFrozen =   0
  245.       WallPaperAlignment=   9
  246.       AccessibleName  =   ""
  247.       AccessibleDescription=   ""
  248.       AccessibleValue =   ""
  249.       AccessibleRole  =   24
  250.    End
  251.    Begin MSComctlLib.Toolbar SzToolbar 
  252.       Align           =   1  'Align Top
  253.       Height          =   555
  254.       Left            =   0
  255.       TabIndex        =   2
  256.       Top             =   0
  257.       Width           =   11715
  258.       _ExtentX        =   20664
  259.       _ExtentY        =   979
  260.       ButtonWidth     =   820
  261.       ButtonHeight    =   926
  262.       AllowCustomize  =   0   'False
  263.       Appearance      =   1
  264.       Style           =   1
  265.       ImageList       =   "ImageList1"
  266.       _Version        =   393216
  267.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  268.          NumButtons      =   12
  269.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  270.             Caption         =   "设置"
  271.             Key             =   "ymsz"
  272.             ImageKey        =   "sz"
  273.          EndProperty
  274.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  275.             Caption         =   "打印"
  276.             Key             =   "dy"
  277.             ImageKey        =   "dy"
  278.          EndProperty
  279.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  280.             Caption         =   "预览"
  281.             Key             =   "yl"
  282.             ImageKey        =   "yl"
  283.          EndProperty
  284.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  285.             Style           =   3
  286.          EndProperty
  287.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  288.             Caption         =   "明细"
  289.             Key             =   "mx"
  290.             ImageKey        =   "mx"
  291.          EndProperty
  292.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  293.             Style           =   4
  294.          EndProperty
  295.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  296.             Caption         =   "分析"
  297.             Key             =   "fx"
  298.             ImageKey        =   "fx"
  299.          EndProperty
  300.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  301.             Style           =   4
  302.          EndProperty
  303.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  304.             Caption         =   "查询"
  305.             Key             =   "cx"
  306.             ImageKey        =   "cx"
  307.          EndProperty
  308.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  309.             Style           =   4
  310.          EndProperty
  311.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  312.             Caption         =   "帮助"
  313.             Key             =   "bz"
  314.             ImageKey        =   "bz"
  315.          EndProperty
  316.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  317.             Caption         =   "退出"
  318.             Key             =   "fh"
  319.             ImageKey        =   "tc"
  320.          EndProperty
  321.       EndProperty
  322.       BorderStyle     =   1
  323.       Begin MSComctlLib.ImageList ImageList1 
  324.          Left            =   5040
  325.          Top             =   0
  326.          _ExtentX        =   1005
  327.          _ExtentY        =   1005
  328.          BackColor       =   -2147483643
  329.          ImageWidth      =   16
  330.          ImageHeight     =   16
  331.          MaskColor       =   12632256
  332.          _Version        =   393216
  333.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  334.             NumListImages   =   11
  335.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  336.                Picture         =   "固定资产总帐.frx":35106
  337.                Key             =   "sz"
  338.             EndProperty
  339.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  340.                Picture         =   "固定资产总帐.frx":354A0
  341.                Key             =   "dy"
  342.             EndProperty
  343.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  344.                Picture         =   "固定资产总帐.frx":3583A
  345.                Key             =   "yl"
  346.             EndProperty
  347.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  348.                Picture         =   "固定资产总帐.frx":35BD4
  349.                Key             =   "cx"
  350.             EndProperty
  351.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  352.                Picture         =   "固定资产总帐.frx":35F6E
  353.                Key             =   "bz"
  354.             EndProperty
  355.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  356.                Picture         =   "固定资产总帐.frx":36308
  357.                Key             =   "tc"
  358.             EndProperty
  359.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  360.                Picture         =   "固定资产总帐.frx":366A2
  361.                Key             =   "bcgs"
  362.             EndProperty
  363.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  364.                Picture         =   "固定资产总帐.frx":36A3C
  365.                Key             =   "mrlk"
  366.             EndProperty
  367.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  368.                Picture         =   "固定资产总帐.frx":36DD6
  369.                Key             =   "xmsz"
  370.             EndProperty
  371.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  372.                Picture         =   "固定资产总帐.frx":37170
  373.                Key             =   "mx"
  374.             EndProperty
  375.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  376.                Picture         =   "固定资产总帐.frx":3750A
  377.                Key             =   "fx"
  378.             EndProperty
  379.          EndProperty
  380.       End
  381.    End
  382. End
  383. Attribute VB_Name = "Book_CheckList"
  384. Attribute VB_GlobalNameSpace = False
  385. Attribute VB_Creatable = False
  386. Attribute VB_PredeclaredId = True
  387. Attribute VB_Exposed = False
  388. '**************************************************************************
  389. '*    模 块 名 称 :固定资产总帐
  390. '*    功 能 描 述 :
  391. '*    程序员姓名  :徐衍民
  392. '*    最后修改人  :徐衍民
  393. '*    最后修改时间:2001/12/13
  394. '*    备        注:
  395. '**************************************************************************
  396. Dim ReportTitle As String                '报表主标题
  397. Dim Card_Str As String                   '用户录入查询条件
  398. Dim rstemp As ADODB.Recordset
  399. '以下为固定使用变量
  400. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  401. Dim GridCode As String                   '显示网格网格代码
  402. Dim GridInf() As Variant                 '整个网格设置信息
  403. Dim Tsxx As String                       '系统提示信息
  404. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  405. Dim Sjhgd As Double                      '网格数据行高度
  406. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  407. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  408. Dim GridStr()  As String                 '网格列信息(字符型)
  409. Dim GridInt() As Integer                 '网格列信息(整型)
  410. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  411. Private Sub Form_Activate()              '保持窗体运行状态为最大化
  412.     Me.WindowState = 2
  413. End Sub
  414. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  415.     
  416.     On Error Resume Next
  417.     
  418.     With CxbbGrid
  419.         .Width = Me.Width - 160
  420.         .Height = Me.Height - .Top - 400
  421.     End With
  422.     
  423.     With Pic_Title
  424.         .Width = Me.Width - 160
  425.     End With
  426.     
  427.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  428. End Sub
  429. Private Sub Form_Load()                  '窗体装入
  430.      
  431.     '调入打印页面设置窗体
  432.     ReportTitle = "固定资产总帐"
  433.     XtReportCode = "Gdzc_CheckList"
  434.     Load Dyymctbl
  435.     
  436.     '调整标题栏及网格、格式工具条位置
  437.     Pic_Title.Left = 40
  438.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  439.     CxbbGrid.Left = Pic_Title.Left
  440.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  441.     
  442.     '调 入 网 格
  443.     GridCode = "Gdzc_CheckList"
  444.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  445.      
  446.     Qslz = GridInf(1)
  447.     Sjhgd = GridInf(2)
  448.     Sfxshjwg = GridInf(7)
  449.     Szzls = CxbbGrid.Cols - 1
  450. End Sub
  451. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  452.     
  453.     '卸载条件窗体
  454.     Book_Check_Search.UnloadCheck.Value = 1
  455.     Unload Book_Check_Search
  456.     '卸载打印页面设置窗体
  457.     Unload Dyymctbl
  458. End Sub
  459. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  460.     
  461.     Select Case Button.Key
  462.         Case "bcgs"                                          '保存表格格式
  463.           Call Bcwggs(CxbbGrid, GridCode, GridStr)
  464.         Case "hfmrgs"                                        '恢复默认格式
  465.           Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  466.         Case "szxsxm"                                        '设置显示项目
  467.           Call Szxsxm(CxbbGrid, GridCode)
  468.     End Select
  469. End Sub
  470. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  471.     
  472.     Select Case Button.Key
  473.         Case "ymsz"                                          '页面设置
  474.             Dyymctbl.Show 1
  475.         Case "yl"                                            '预 览
  476.             Call bbyl(True)
  477.         Case "dy"                                            '打 印
  478.             Call bbyl(False)
  479.         Case "mx"                                            '明细
  480.             If CxbbGrid.Rows <= CxbbGrid.FixedRows Then
  481.                 Exit Sub
  482.             End If
  483.             Call Parti
  484.         Case "fx"
  485.             Call Txfxbb(CxbbGrid, "Gdzc_Book_Check")
  486.         Case "cx"                                            '查 询
  487.             Book_Check_Search.Show 1
  488.         Case "fh"                                            '退 出
  489.             Unload Me
  490.         Case "bz"
  491.             SendKeys "{F1}"
  492.      End Select
  493.      
  494. End Sub
  495. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  496.     
  497.     Timer1.Enabled = False
  498.     Xt_Wait.Show
  499.     Xt_Wait.Refresh
  500.     
  501.     '加快显示速度
  502.     CxbbGrid.Redraw = False
  503.     
  504.     '生成查询结果
  505.     Call Sub_Query
  506.     
  507.     CxbbGrid.Redraw = True
  508.      
  509.     Xt_Wait.Hide
  510.     
  511. End Sub
  512. Private Sub Sub_Query()                                    '生成查询结果
  513.     
  514.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  515.     Dim Sqlstr As String                        '查询字符串
  516.     Dim Coljsq As Long                          '网格列计数器
  517.     Dim Jsqte As Integer                        '临时动态计数器
  518.     '以下为自定义部分[
  519.     With Book_Check_Search
  520.         '生成查询条件
  521.         Card_Str = " where 1=1 "
  522.         For Jsqte = 1 To 3
  523.             Select Case Jsqte
  524.                 Case 1      '会计年度
  525.                     If Trim(.YearCombo.Text) <> "" Then
  526.                         Card_Str = Card_Str & " And Gdzc_Total.year=" & Trim(.YearCombo.Text)
  527.                         Lab_TitleText(0).Caption = Trim(.YearCombo.Text)
  528.                     End If
  529.                 Case 2      '资产类别
  530.                     If Trim(.LrText(0).Text) <> "" Then
  531.                         Card_Str = Card_Str & " and Gdzc_Total.FASortCode like '" & Trim(.LrText(0).Tag) & "%'"
  532.                         Lab_TitleText(1).Caption = Trim(.LrText(0).Text)
  533.                         Lab_TitleText(1).Tag = Trim(.LrText(0).Tag)
  534.                     Else
  535.                         Lab_TitleText(1).Caption = "所有资产类别"
  536.                         Lab_TitleText(1).Tag = ""
  537.                     End If
  538.                 Case 3      '所属部门
  539.                     If Trim(.LrText(1).Text) <> "" Then
  540.                         Card_Str = Card_Str & " and Gdzc_Total.DeptCode like '" & Trim(.LrText(1).Tag) & "%'"
  541.                         Lab_TitleText(2).Caption = Trim(.LrText(1).Text)
  542.                         Lab_TitleText(2).Tag = Trim(.LrText(1).Tag)
  543.                     Else
  544.                         Lab_TitleText(2).Caption = "所有部门"
  545.                         Lab_TitleText(2).Tag = ""
  546.                     End If
  547.             End Select
  548.         Next Jsqte
  549.     End With
  550.  
  551.     Sqlstr = "SELECT Gdzc_Total.Period, SUM(Gdzc_Total.FAValueStartM) AS FAValueStartM, " _
  552.         & "SUM(Gdzc_Total.FAValueInM) AS FAValueInM, SUM(Gdzc_Total.FAValueOutM) " _
  553.         & "AS FAValueOutM, SUM(Gdzc_Total.DeprSumStartM) AS DeprSumStartM, " _
  554.         & "SUM(Gdzc_Total.DeprSumOutM) AS DeprSumOutM, SUM(Gdzc_Total.DeprSumInM) " _
  555.         & "AS DeprSumInM FROM Gdzc_Total LEFT OUTER JOIN Gy_Department ON " _
  556.         & "Gdzc_Total.DeptCode = Gy_Department.DeptCode LEFT OUTER JOIN " _
  557.         & "Gdzc_Sort ON Gdzc_Total.FASortCode = Gdzc_Sort.FASortCode "
  558.     
  559.     Sqlstr = Sqlstr & Trim(Card_Str) & " group by gdzc_total.period ORDER BY Gdzc_Total.Period"
  560.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  561.     With Rec_Query
  562.         CxbbGrid.Rows = CxbbGrid.FixedRows
  563.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  564.         Jsqte = CxbbGrid.FixedRows
  565.         Do While Not .EOF
  566.             If Jsqte >= CxbbGrid.Rows Then
  567.                 CxbbGrid.AddItem ""
  568.             End If
  569.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(Format(!Period, "00") & "")                             '会计期间
  570.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(!FAValueStartM & "")                       '期初资产原值
  571.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(!FAValueInM & "")                          '资产原值借方
  572.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(!FAValueOutM & "")                         '资产原值贷方
  573.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Val(Val(!FAValueStartM) + Val(!FAValueInM) - Val(!FAValueOutM)) & "")  '资产原值余额
  574.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(!DeprSumStartM & "")                       '期初累计折旧
  575.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(!DeprSumOutM & "")                         '累计折旧借方
  576.             CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(!DeprSumInM & "")                          '累计折旧贷方
  577.             CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(Val(Val(!DeprSumStartM) + Val(!DeprSumInM) - Val(!DeprSumOutM)) & "")  '累计折旧余额
  578.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(Val(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) & "") - Val(CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) & "")) & "")   '净资产
  579.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  580.             .MoveNext
  581.             Jsqte = Jsqte + 1
  582.         Loop
  583.     End With
  584.     
  585.     '为零时清空单元格
  586.     Call Txt_Clear
  587.     
  588. End Sub
  589. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  590.     
  591.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  592.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  593.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  594.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  595.     ReDim Bbxbt(1 To Bbxbtgs)
  596.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  597.     
  598.     If Bbbwhgs <> 0 Then
  599.         ReDim Bbbwh(1 To Bbbwhgs)
  600.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  601.     End If
  602.     
  603.     Bbzbt = ReportTitle
  604.     Bbxbt(1) = " "
  605.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  606.     
  607.     Bbxbt(1) = Space(2) + Fun_FormatOutPut(Trim(Lab_TitleMess(0).Caption) & Trim(Lab_TitleText(0).Caption), 35)
  608.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lab_TitleMess(1).Caption) & Trim(Lab_TitleText(1).Caption), 35)
  609.     Bbxbt(1) = Bbxbt(1) + Trim(Trim(Lab_TitleMess(2).Caption) & Trim(Lab_TitleText(2).Caption))
  610.     
  611.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  612.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  613.   
  614.     If Not bbylte Then
  615.         Unload DY_Tybbyldy
  616.     End If
  617. End Sub
  618. '*****************************************************************
  619. '[>>自定义函数
  620. '向资产明细帐查询条件传值
  621. Function Parti()
  622.     
  623.     If CxbbGrid.Row <= CxbbGrid.FixedRows - 1 Then Exit Function            '数据行为空时不执行下一步工作
  624.     
  625.     Load Book_Parti
  626.     Book_Parti_Search.Com_Year(0).Text = Book_Parti_Search.Com_Year(0).List(0)
  627.     Book_Parti_Search.Com_Year(1).Text = Book_Parti_Search.Com_Year(1).List(Book_Parti_Search.Com_Year(1).ListCount - 1)
  628.     Book_Parti_Search.LrText(0).Text = Book_Check_Search.LrText(0).Text
  629.     Book_Parti_Search.LrText(1).Text = Book_Check_Search.LrText(1).Text
  630.     Book_Parti_Search.LrText(0).Tag = Book_Check_Search.LrText(0).Tag
  631.     Book_Parti_Search.LrText(1).Tag = Book_Check_Search.LrText(1).Tag
  632.     Book_Parti.Timer1.Enabled = True
  633.     Book_Parti.Show
  634.     
  635. End Function
  636. '为零时清空单元格
  637. Function Txt_Clear()
  638.     Dim Row_Integer, Col_Integer As Integer         '行数和列数变量
  639.     
  640.     For Row_Integer = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  641.         For Col_Integer = 1 To CxbbGrid.Cols - 1
  642.             If Val(CxbbGrid.TextMatrix(Row_Integer, Col_Integer)) = 0 Then
  643.                 CxbbGrid.TextMatrix(Row_Integer, Col_Integer) = ""
  644.             End If
  645.         Next Col_Integer
  646.     Next Row_Integer
  647.     
  648. End Function
  649. '<<]
  650. '****************************************************