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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "vslight6.OCX"
  3. Object = "{C5DE3F80-3376-11D2-BAA4-04F205C10000}#1.0#0"; "Vsflex6d.ocx"
  4. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  5. Begin VB.Form FAVari_CardList 
  6.    Caption         =   "资产卡片列表"
  7.    ClientHeight    =   8595
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   11880
  11.    Icon            =   "变动卡片查询结果.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11880
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.PictureBox Pic_Title 
  19.       Height          =   825
  20.       Left            =   0
  21.       Picture         =   "变动卡片查询结果.frx":1042
  22.       ScaleHeight     =   765
  23.       ScaleWidth      =   11835
  24.       TabIndex        =   1
  25.       Top             =   555
  26.       Width           =   11895
  27.       Begin MSComctlLib.ImageList ImageList1 
  28.          Left            =   0
  29.          Top             =   0
  30.          _ExtentX        =   1005
  31.          _ExtentY        =   1005
  32.          BackColor       =   -2147483643
  33.          ImageWidth      =   16
  34.          ImageHeight     =   16
  35.          MaskColor       =   12632256
  36.          _Version        =   393216
  37.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  38.             NumListImages   =   31
  39.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  40.                Picture         =   "变动卡片查询结果.frx":35106
  41.                Key             =   "sz"
  42.             EndProperty
  43.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  44.                Picture         =   "变动卡片查询结果.frx":354A0
  45.                Key             =   "dy"
  46.             EndProperty
  47.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  48.                Picture         =   "变动卡片查询结果.frx":3583A
  49.                Key             =   "yl"
  50.             EndProperty
  51.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.                Picture         =   "变动卡片查询结果.frx":35BD4
  53.                Key             =   "xg"
  54.             EndProperty
  55.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.                Picture         =   "变动卡片查询结果.frx":35F6E
  57.                Key             =   "zh"
  58.             EndProperty
  59.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.                Picture         =   "变动卡片查询结果.frx":36308
  61.                Key             =   "sh"
  62.             EndProperty
  63.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.                Picture         =   "变动卡片查询结果.frx":366A2
  65.                Key             =   "bc"
  66.             EndProperty
  67.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.                Picture         =   "变动卡片查询结果.frx":36A3C
  69.                Key             =   "fq"
  70.             EndProperty
  71.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  72.                Picture         =   "变动卡片查询结果.frx":36DD6
  73.                Key             =   "bz"
  74.             EndProperty
  75.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  76.                Picture         =   "变动卡片查询结果.frx":37170
  77.                Key             =   "tc"
  78.             EndProperty
  79.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.                Picture         =   "变动卡片查询结果.frx":3750A
  81.                Key             =   "bcgs"
  82.             EndProperty
  83.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.                Picture         =   "变动卡片查询结果.frx":378A4
  85.                Key             =   "mrlk"
  86.             EndProperty
  87.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  88.                Picture         =   "变动卡片查询结果.frx":37C3E
  89.                Key             =   "xsxm"
  90.             EndProperty
  91.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  92.                Picture         =   "变动卡片查询结果.frx":37FD8
  93.                Key             =   "first"
  94.             EndProperty
  95.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  96.                Picture         =   "变动卡片查询结果.frx":38372
  97.                Key             =   "prev"
  98.             EndProperty
  99.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.                Picture         =   "变动卡片查询结果.frx":3870C
  101.                Key             =   "next"
  102.             EndProperty
  103.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  104.                Picture         =   "变动卡片查询结果.frx":38AA6
  105.                Key             =   "last"
  106.             EndProperty
  107.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  108.                Picture         =   "变动卡片查询结果.frx":38E40
  109.                Key             =   "xx"
  110.             EndProperty
  111.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  112.                Picture         =   "变动卡片查询结果.frx":391DA
  113.                Key             =   "define"
  114.             EndProperty
  115.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  116.                Picture         =   "变动卡片查询结果.frx":39574
  117.                Key             =   "exec"
  118.             EndProperty
  119.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  120.                Picture         =   "变动卡片查询结果.frx":3990E
  121.                Key             =   "xz"
  122.             EndProperty
  123.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  124.                Picture         =   "变动卡片查询结果.frx":39CA8
  125.                Key             =   "sc"
  126.             EndProperty
  127.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  128.                Picture         =   "变动卡片查询结果.frx":3A042
  129.                Key             =   "sx"
  130.             EndProperty
  131.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  132.                Picture         =   "变动卡片查询结果.frx":3A3DC
  133.                Key             =   "cx"
  134.             EndProperty
  135.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  136.                Picture         =   "变动卡片查询结果.frx":3A776
  137.                Key             =   "zd"
  138.             EndProperty
  139.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  140.                Picture         =   "变动卡片查询结果.frx":3AB10
  141.                Key             =   "dz"
  142.             EndProperty
  143.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  144.                Picture         =   "变动卡片查询结果.frx":3AEAA
  145.                Key             =   "ph"
  146.             EndProperty
  147.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  148.                Picture         =   "变动卡片查询结果.frx":3B244
  149.                Key             =   "fz"
  150.             EndProperty
  151.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  152.                Picture         =   "变动卡片查询结果.frx":3B5DE
  153.                Key             =   "dw"
  154.             EndProperty
  155.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  156.                Picture         =   "变动卡片查询结果.frx":3B978
  157.                Key             =   "bd"
  158.             EndProperty
  159.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  160.                Picture         =   "变动卡片查询结果.frx":3BD12
  161.                Key             =   "js"
  162.             EndProperty
  163.          EndProperty
  164.       End
  165.       Begin VB.Label tsLabel 
  166.          AutoSize        =   -1  'True
  167.          BackColor       =   &H80000018&
  168.          BackStyle       =   0  'Transparent
  169.          Caption         =   "资产卡片列表"
  170.          BeginProperty Font 
  171.             Name            =   "宋体"
  172.             Size            =   15.75
  173.             Charset         =   134
  174.             Weight          =   700
  175.             Underline       =   0   'False
  176.             Italic          =   0   'False
  177.             Strikethrough   =   0   'False
  178.          EndProperty
  179.          ForeColor       =   &H00000000&
  180.          Height          =   315
  181.          Index           =   4
  182.          Left            =   495
  183.          TabIndex        =   2
  184.          Top             =   150
  185.          Width           =   1980
  186.       End
  187.    End
  188.    Begin VB.Timer Timer1 
  189.       Enabled         =   0   'False
  190.       Interval        =   1
  191.       Left            =   6540
  192.       Top             =   45
  193.    End
  194.    Begin VSFlex6DAOCtl.vsFlexGrid CxbbGrid 
  195.       Height          =   7215
  196.       Left            =   0
  197.       TabIndex        =   0
  198.       Top             =   1425
  199.       Width           =   11895
  200.       _ExtentX        =   20981
  201.       _ExtentY        =   12726
  202.       _ConvInfo       =   1
  203.       Appearance      =   1
  204.       BorderStyle     =   1
  205.       Enabled         =   -1  'True
  206.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  207.          Name            =   "宋体"
  208.          Size            =   9
  209.          Charset         =   134
  210.          Weight          =   400
  211.          Underline       =   0   'False
  212.          Italic          =   0   'False
  213.          Strikethrough   =   0   'False
  214.       EndProperty
  215.       MousePointer    =   0
  216.       BackColor       =   -2147483643
  217.       ForeColor       =   -2147483640
  218.       BackColorFixed  =   -2147483633
  219.       ForeColorFixed  =   -2147483630
  220.       BackColorSel    =   -2147483635
  221.       ForeColorSel    =   -2147483634
  222.       BackColorBkg    =   -2147483636
  223.       BackColorAlternate=   -2147483643
  224.       GridColor       =   -2147483633
  225.       GridColorFixed  =   -2147483632
  226.       TreeColor       =   -2147483632
  227.       FloodColor      =   192
  228.       SheetBorder     =   -2147483642
  229.       FocusRect       =   1
  230.       HighLight       =   1
  231.       AllowSelection  =   -1  'True
  232.       AllowBigSelection=   -1  'True
  233.       AllowUserResizing=   0
  234.       SelectionMode   =   0
  235.       GridLines       =   1
  236.       GridLinesFixed  =   2
  237.       GridLineWidth   =   1
  238.       Rows            =   50
  239.       Cols            =   10
  240.       FixedRows       =   1
  241.       FixedCols       =   1
  242.       RowHeightMin    =   0
  243.       RowHeightMax    =   0
  244.       ColWidthMin     =   0
  245.       ColWidthMax     =   0
  246.       ExtendLastCol   =   0   'False
  247.       FormatString    =   ""
  248.       ScrollTrack     =   0   'False
  249.       ScrollBars      =   3
  250.       ScrollTips      =   0   'False
  251.       MergeCells      =   0
  252.       MergeCompare    =   0
  253.       AutoResize      =   -1  'True
  254.       AutoSizeMode    =   0
  255.       AutoSearch      =   0
  256.       MultiTotals     =   -1  'True
  257.       SubtotalPosition=   1
  258.       OutlineBar      =   0
  259.       OutlineCol      =   0
  260.       Ellipsis        =   0
  261.       ExplorerBar     =   0
  262.       PicturesOver    =   0   'False
  263.       FillStyle       =   0
  264.       RightToLeft     =   0   'False
  265.       PictureType     =   0
  266.       TabBehavior     =   0
  267.       OwnerDraw       =   0
  268.       Editable        =   0   'False
  269.       ShowComboButton =   -1  'True
  270.       WordWrap        =   0   'False
  271.       TextStyle       =   0
  272.       TextStyleFixed  =   0
  273.       OleDragMode     =   0
  274.       OleDropMode     =   0
  275.       DataMode        =   0
  276.       VirtualData     =   -1  'True
  277.    End
  278.    Begin MSComctlLib.Toolbar GsToolbar 
  279.       Height          =   540
  280.       Left            =   9240
  281.       TabIndex        =   3
  282.       Top             =   15
  283.       Width           =   2595
  284.       _ExtentX        =   4577
  285.       _ExtentY        =   953
  286.       ButtonWidth     =   1455
  287.       ButtonHeight    =   953
  288.       Appearance      =   1
  289.       Style           =   1
  290.       ImageList       =   "ImageList1"
  291.       _Version        =   393216
  292.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  293.          NumButtons      =   3
  294.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  295.             Caption         =   "保存格式"
  296.             Key             =   "bcgs"
  297.             ImageKey        =   "bcgs"
  298.          EndProperty
  299.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  300.             Caption         =   "默认列宽"
  301.             Key             =   "hfmrgs"
  302.             ImageKey        =   "mrlk"
  303.          EndProperty
  304.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  305.             Caption         =   "显示项目"
  306.             Key             =   "szxsxm"
  307.             ImageKey        =   "xsxm"
  308.          EndProperty
  309.       EndProperty
  310.    End
  311.    Begin MSComctlLib.Toolbar SzToolbar 
  312.       Align           =   1  'Align Top
  313.       Height          =   570
  314.       Left            =   0
  315.       TabIndex        =   4
  316.       Top             =   0
  317.       Width           =   11880
  318.       _ExtentX        =   20955
  319.       _ExtentY        =   1005
  320.       ButtonWidth     =   820
  321.       ButtonHeight    =   953
  322.       AllowCustomize  =   0   'False
  323.       Appearance      =   1
  324.       Style           =   1
  325.       ImageList       =   "ImageList1"
  326.       _Version        =   393216
  327.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  328.          NumButtons      =   13
  329.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  330.             Caption         =   "设置"
  331.             Key             =   "ymsz"
  332.             ImageKey        =   "sz"
  333.          EndProperty
  334.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  335.             Caption         =   "打印"
  336.             Key             =   "dy"
  337.             ImageKey        =   "dy"
  338.          EndProperty
  339.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  340.             Caption         =   "预览"
  341.             Key             =   "yl"
  342.             ImageKey        =   "yl"
  343.          EndProperty
  344.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  345.             Style           =   3
  346.          EndProperty
  347.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  348.             Caption         =   "变动"
  349.             Key             =   "bd"
  350.             ImageKey        =   "bd"
  351.          EndProperty
  352.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  353.             Style           =   3
  354.          EndProperty
  355.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  356.             Caption         =   "减少"
  357.             Key             =   "js"
  358.             ImageKey        =   "js"
  359.          EndProperty
  360.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  361.             Style           =   4
  362.          EndProperty
  363.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  364.             Caption         =   "查询"
  365.             Key             =   "cx"
  366.             ImageKey        =   "cx"
  367.          EndProperty
  368.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  369.             Object.Visible         =   0   'False
  370.             Caption         =   "图形"
  371.             Key             =   "tx"
  372.          EndProperty
  373.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  374.             Style           =   3
  375.          EndProperty
  376.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  377.             Caption         =   "帮助"
  378.             Key             =   "bz"
  379.             ImageKey        =   "bz"
  380.          EndProperty
  381.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  382.             Caption         =   "退出"
  383.             Key             =   "fh"
  384.             ImageKey        =   "tc"
  385.          EndProperty
  386.       EndProperty
  387.       BorderStyle     =   1
  388.       Begin VB.TextBox Txt_Bit 
  389.          Height          =   270
  390.          Left            =   5070
  391.          TabIndex        =   5
  392.          Text            =   "Text1"
  393.          Top             =   1230
  394.          Visible         =   0   'False
  395.          Width           =   1035
  396.       End
  397.    End
  398. End
  399. Attribute VB_Name = "FAVari_CardList"
  400. Attribute VB_GlobalNameSpace = False
  401. Attribute VB_Creatable = False
  402. Attribute VB_PredeclaredId = True
  403. Attribute VB_Exposed = False
  404. '**************************************************************************
  405. '*    模 块 名 称 :卡片列表
  406. '*    功 能 描 述 :
  407. '*    程序员姓名  :徐衍民
  408. '*    最后修改人  :徐衍民
  409. '*    最后修改时间:2001/11/28
  410. '*    备        注:
  411. '**************************************************************************
  412. Dim ReportTitle As String                '报表主标题
  413. Dim Card_Str As String                   '用户录入查询条件
  414. Dim RsTemp As ADODB.Recordset
  415. '以下为固定使用变量
  416. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  417. Dim GridCode As String                   '显示网格网格代码
  418. Dim GridInf() As Variant                 '整个网格设置信息
  419. Dim Tsxx As String                       '系统提示信息
  420. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  421. Dim Sjhgd As Double                      '网格数据行高度
  422. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  423. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  424. Dim GridStr()  As String                 '网格列信息(字符型)
  425. Dim GridInt() As Integer                 '网格列信息(整型)
  426. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  427. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  428.     
  429.     On Error Resume Next
  430.     With CxbbGrid
  431.         .Width = Me.Width - 160
  432.         .Height = Me.Height - .Top - 400
  433.     End With
  434.     With Pic_Title
  435.         .Width = Me.Width - 160
  436.     End With
  437.     
  438.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  439. End Sub
  440. Private Sub Form_Load()                                                   '窗体装入
  441.      
  442.     '调入打印页面设置窗体
  443.     ReportTitle = "固定资产卡片列表"
  444.     XtReportCode = "Gdzc_V_CardList"
  445.     Load Dyymctbl
  446.      
  447.     '调整标题栏及网格、格式工具条位置
  448.     Pic_Title.Left = 40
  449.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  450.     CxbbGrid.Left = Pic_Title.Left
  451.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  452.     
  453.     '调 入 网 格
  454.     GridCode = "Gdzc_V_CardList"
  455.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  456.      
  457.     Qslz = GridInf(1)
  458.     Sjhgd = GridInf(2)
  459.     Sfxshjwg = GridInf(7)
  460.     Szzls = CxbbGrid.Cols - 1
  461.     
  462. End Sub
  463. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  464.     
  465.     '卸载条件窗体
  466.     FAVari_Search.UnloadCheck.Value = 1
  467.     Unload FAVari_Search
  468.     '卸载打印页面设置窗体
  469.     Unload Dyymctbl
  470. End Sub
  471. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  472.     
  473.     Select Case Button.Key
  474.         Case "bcgs"                                          '保存表格格式
  475.           Call Bcwggs(CxbbGrid, GridCode, GridStr)
  476.         Case "hfmrgs"                                        '恢复默认格式
  477.           Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  478.         Case "szxsxm"                                        '设置显示项目
  479.           Call Szxsxm(CxbbGrid, GridCode)
  480.     End Select
  481. End Sub
  482. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  483.     
  484.     Select Case Button.Key
  485.         Case "ymsz"                                          '页面设置
  486.             Dyymctbl.Show 1
  487.         Case "yl"                                            '预 览
  488.             Call bbyl(True)
  489.         Case "dy"                                            '打 印
  490.             Call bbyl(False)
  491.         Case "bd"                                            '变动
  492.             If CxbbGrid.Rows > 1 And Edit_Bit = True Then
  493.                 FAVari_Variation.Lbl_Num = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  494.                 FAVari_Variation.Show 1
  495.             End If
  496.         Case "js"                                            '减少
  497.             If CxbbGrid.Rows > 1 And Edit_Bit = True Then
  498.                 FAVari_Lessen.Lbl_Num = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  499.                 FAVari_Lessen.Show 1
  500.             End If
  501.         Case "cx"                                            '查 询
  502.             FAVari_Search.Show 1
  503.         Case "fh"                                            '退 出
  504.             Unload Me
  505.      End Select
  506.      
  507. End Sub
  508. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  509.     Timer1.Enabled = False
  510.     Xt_Wait.Show
  511.     Xt_Wait.Refresh
  512.     
  513.     '加快显示速度
  514.     CxbbGrid.Redraw = False
  515.     
  516.     '生成查询结果
  517.     Call Sub_Query
  518.     
  519.     CxbbGrid.Redraw = True
  520.      
  521.     Xt_Wait.Hide
  522.     
  523. End Sub
  524. Private Sub Sub_Query()                                    '生成查询结果
  525.     
  526.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  527.     Dim Sqlstr As String                        '查询字符串
  528.     Dim Coljsq As Long                          '网格列计数器
  529.     Dim jsqte As Integer                        '临时动态计数器
  530.     '以下为自定义部分[
  531.     With FAVari_Search
  532.         '生成查询条件
  533.         Card_Str = " where 1=1 "
  534.         For jsqte = 1 To 9
  535.             Select Case jsqte
  536.                 Case 1      '卡片开始录入日期
  537.                     If Trim(.lrtext(0).Text) <> "" Then
  538.                         Card_Str = Card_Str & " And writedate>=' " & Trim(.lrtext(0).Text) & "'"
  539.                     End If
  540.                 Case 2      '卡片录入终止日期
  541.                     If Trim(.lrtext(1).Text) <> "" Then
  542.                         Card_Str = Card_Str & " and writedate <= '" & Trim(.lrtext(1).Text) & "'"
  543.                     End If
  544.                 Case 3      '卡片编号(开始)
  545.                     If Trim(.lrtext(2).Text) <> "" Then
  546.                         Card_Str = Card_Str & " and Cardcode>=" & Trim(.lrtext(2).Text)
  547.                     End If
  548.                 Case 4      '卡片编号(终止)
  549.                     If Trim(.lrtext(3).Text) <> "" Then
  550.                         Card_Str = Card_Str & " and cardcode<=" & Trim(.lrtext(3).Text)
  551.                     End If
  552.                 Case 5      '资产编号
  553.                     If Trim(.lrtext(4).Text) <> "" Then
  554.                         Card_Str = Card_Str & " and FACode>=" & Trim(.lrtext(4).Text)
  555.                     End If
  556.                 Case 6      '资产编号
  557.                     If Trim(.lrtext(5).Text) <> "" Then
  558.                         Card_Str = Card_Str & " and FACode<=" & Trim(.lrtext(5).Text)
  559.                     End If
  560.                 Case 7      '资产类别编号
  561.                     If Trim(.lrtext(6).Text) <> "" Then
  562.                         Card_Str = Card_Str & " and FASortCode='" & Trim(.lrtext(6).Tag) & "'"
  563.                     End If
  564.                 Case 8      '部门编号
  565.                     If Trim(.lrtext(7).Text) <> "" Then
  566.                         Card_Str = Card_Str & " and DeptCode='" & Trim(.lrtext(7).Tag) & "'"
  567.                     End If
  568.                 Case 9      '设备位号
  569.                     If Trim(.lrtext(8).Text) <> "" Then
  570.                         Card_Str = Card_Str & " and setlocaNum='" & Trim(.lrtext(8).Text) & "'"
  571.                     End If
  572.             End Select
  573.         Next jsqte
  574.     End With
  575.  
  576.     Sqlstr = "SELECT * From Gdzc_V_CardList " & Card_Str & " ORDER BY CardCode"
  577.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  578.     With Rec_Query
  579.     CxbbGrid.Rows = CxbbGrid.FixedRows
  580.     CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  581.     jsqte = CxbbGrid.FixedRows
  582.    
  583.     Do While Not .EOF
  584.         If jsqte >= CxbbGrid.Rows Then
  585.             CxbbGrid.AddItem ""
  586.         End If
  587.         
  588.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CardCode") & "")
  589.         CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("FASortName") & "")
  590.         CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("FACode") & "")
  591.         CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("FAName") & "")
  592.         CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("SpecificationMode") & "")
  593.         CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("MeasureUnit"))
  594.         CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("FAQuantity"))
  595.         CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("FAVariName"))
  596.         CxbbGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("FAValue") & "")
  597.         CxbbGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("UseYears") & "")
  598.         CxbbGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("DeprSum"))
  599.         CxbbGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("FactValue"))
  600.         Select Case .Fields("DeprMethod")                                                                        '折旧方法
  601.             Case "01"
  602.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "不计提折旧"
  603.             Case "02"
  604.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "平均年限法(依净资产计提折旧)"
  605.             Case "03"
  606.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "平均年限法(依帐面原值计提折旧)"
  607.             Case "04"
  608.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "工作量法"
  609.             Case "05"
  610.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "固定折旧额折旧法"
  611.             Case "06"
  612.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "年数总和法"
  613.             Case "07"
  614.                 CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = "双倍余额法"
  615.         End Select
  616.         CxbbGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Format(.Fields("BeginUseDate"), "yyyy-mm-dd")
  617.         CxbbGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("SetLocaNum") & "")
  618.         CxbbGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = Format(.Fields("WriteDate"), "yyyy-mm-dd")
  619.         CxbbGrid.RowHeight(jsqte) = Sjhgd
  620.         .MoveNext
  621.         jsqte = jsqte + 1
  622.     Loop
  623.     End With
  624.     
  625.  ']以上为用户自定义部分
  626. End Sub
  627. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  628.     
  629.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  630.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  631.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  632.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  633.     ReDim Bbxbt(1 To Bbxbtgs)
  634.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  635.     
  636.     If Bbbwhgs <> 0 Then
  637.         ReDim Bbbwh(1 To Bbbwhgs)
  638.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  639.     End If
  640.     
  641.     Bbzbt = ReportTitle
  642.     Bbxbt(1) = " "
  643.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  644.     
  645.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  646.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  647.   
  648.     If Not bbylte Then
  649.         Unload DY_Tybbyldy
  650.     End If
  651. End Sub
  652. '******************************************************************************************************************************************************
  653. '[>>自定义函数或者过程
  654. Function Edit_Bit() As Boolean
  655.     
  656.     Edit_Bit = False
  657.     
  658.     Set RsTemp = New ADODB.Recordset
  659.     RsTemp.Open "select * from gdZc_card where cardCode='" & Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) & "' and year=" & Xtyear & " and period=" & Xtmm, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  660.     If RsTemp.EOF Then
  661.         Edit_Bit = True
  662.     Else
  663.         MsgBox "本会计期间录入卡片只能进行修改或删除!", vbOKOnly + vbInformation, "固定资产管理系统"
  664.         Exit Function
  665.     End If
  666.     RsTemp.Close
  667.     Set RsTemp = Nothing
  668.     
  669. End Function
  670. '<<]
  671. '******************************************************************************************************************************************************