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

企业管理

开发平台:

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 YS_FrmAccntBudget 
  5.    BackColor       =   &H00C0C0C0&
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "科目预算表"
  8.    ClientHeight    =   7965
  9.    ClientLeft      =   675
  10.    ClientTop       =   720
  11.    ClientWidth     =   11400
  12.    BeginProperty Font 
  13.       Name            =   "宋体"
  14.       Size            =   14.25
  15.       Charset         =   0
  16.       Weight          =   700
  17.       Underline       =   0   'False
  18.       Italic          =   0   'False
  19.       Strikethrough   =   0   'False
  20.    EndProperty
  21.    HelpContextID   =   411004003
  22.    Icon            =   "预算设置_科目预算.frx":0000
  23.    KeyPreview      =   -1  'True
  24.    LinkTopic       =   "Form4"
  25.    MaxButton       =   0   'False
  26.    MinButton       =   0   'False
  27.    ScaleHeight     =   7965
  28.    ScaleWidth      =   11400
  29.    StartUpPosition =   1  '所有者中心
  30.    Begin VB.CommandButton Ydcommand 
  31.       BeginProperty Font 
  32.          Name            =   "MS Sans Serif"
  33.          Size            =   8.25
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   300
  41.       Left            =   9030
  42.       Picture         =   "预算设置_科目预算.frx":1042
  43.       Style           =   1  'Graphical
  44.       TabIndex        =   1
  45.       Top             =   3660
  46.       Visible         =   0   'False
  47.       Width           =   300
  48.    End
  49.    Begin VB.PictureBox Pic_Title 
  50.       BeginProperty Font 
  51.          Name            =   "MS Sans Serif"
  52.          Size            =   8.25
  53.          Charset         =   0
  54.          Weight          =   400
  55.          Underline       =   0   'False
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       Height          =   1125
  60.       Left            =   0
  61.       Picture         =   "预算设置_科目预算.frx":13CC
  62.       ScaleHeight     =   1065
  63.       ScaleWidth      =   11715
  64.       TabIndex        =   7
  65.       Top             =   570
  66.       Width           =   11775
  67.       Begin MSComctlLib.ImageList ImageList1 
  68.          Left            =   4260
  69.          Top             =   60
  70.          _ExtentX        =   1005
  71.          _ExtentY        =   1005
  72.          BackColor       =   -2147483643
  73.          ImageWidth      =   16
  74.          ImageHeight     =   16
  75.          MaskColor       =   12632256
  76.          _Version        =   393216
  77.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  78.             NumListImages   =   25
  79.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.                Picture         =   "预算设置_科目预算.frx":35490
  81.                Key             =   "sz"
  82.             EndProperty
  83.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.                Picture         =   "预算设置_科目预算.frx":3582A
  85.                Key             =   "dy"
  86.             EndProperty
  87.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  88.                Picture         =   "预算设置_科目预算.frx":35BC4
  89.                Key             =   "yl"
  90.             EndProperty
  91.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  92.                Picture         =   "预算设置_科目预算.frx":35F5E
  93.                Key             =   "xg"
  94.             EndProperty
  95.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  96.                Picture         =   "预算设置_科目预算.frx":362F8
  97.                Key             =   "zh"
  98.             EndProperty
  99.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.                Picture         =   "预算设置_科目预算.frx":36692
  101.                Key             =   "sh"
  102.             EndProperty
  103.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  104.                Picture         =   "预算设置_科目预算.frx":36A2C
  105.                Key             =   "bc"
  106.             EndProperty
  107.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  108.                Picture         =   "预算设置_科目预算.frx":36DC6
  109.                Key             =   "fq"
  110.             EndProperty
  111.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  112.                Picture         =   "预算设置_科目预算.frx":37160
  113.                Key             =   "bz"
  114.             EndProperty
  115.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  116.                Picture         =   "预算设置_科目预算.frx":374FA
  117.                Key             =   "tc"
  118.             EndProperty
  119.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  120.                Picture         =   "预算设置_科目预算.frx":37894
  121.                Key             =   "bcgs"
  122.             EndProperty
  123.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  124.                Picture         =   "预算设置_科目预算.frx":37C2E
  125.                Key             =   "mrlk"
  126.             EndProperty
  127.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  128.                Picture         =   "预算设置_科目预算.frx":37FC8
  129.                Key             =   "xsxm"
  130.             EndProperty
  131.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  132.                Picture         =   "预算设置_科目预算.frx":38362
  133.                Key             =   "first"
  134.             EndProperty
  135.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  136.                Picture         =   "预算设置_科目预算.frx":386FC
  137.                Key             =   "prev"
  138.             EndProperty
  139.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  140.                Picture         =   "预算设置_科目预算.frx":38A96
  141.                Key             =   "next"
  142.             EndProperty
  143.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  144.                Picture         =   "预算设置_科目预算.frx":38E30
  145.                Key             =   "last"
  146.             EndProperty
  147.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  148.                Picture         =   "预算设置_科目预算.frx":391CA
  149.                Key             =   "xx"
  150.             EndProperty
  151.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  152.                Picture         =   "预算设置_科目预算.frx":39564
  153.                Key             =   "define"
  154.             EndProperty
  155.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  156.                Picture         =   "预算设置_科目预算.frx":398FE
  157.                Key             =   "exec"
  158.             EndProperty
  159.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  160.                Picture         =   "预算设置_科目预算.frx":39C98
  161.                Key             =   "xz"
  162.             EndProperty
  163.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  164.                Picture         =   "预算设置_科目预算.frx":3A032
  165.                Key             =   "sc"
  166.             EndProperty
  167.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  168.                Picture         =   "预算设置_科目预算.frx":3A3CC
  169.                Key             =   "sx"
  170.             EndProperty
  171.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  172.                Picture         =   "预算设置_科目预算.frx":3A766
  173.                Key             =   "cx"
  174.             EndProperty
  175.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  176.                Picture         =   "预算设置_科目预算.frx":3AB00
  177.                Key             =   "zd"
  178.             EndProperty
  179.          EndProperty
  180.       End
  181.       Begin VB.Label lbl_AccountYear 
  182.          BackStyle       =   0  'Transparent
  183.          BeginProperty Font 
  184.             Name            =   "MS Sans Serif"
  185.             Size            =   8.25
  186.             Charset         =   0
  187.             Weight          =   400
  188.             Underline       =   0   'False
  189.             Italic          =   0   'False
  190.             Strikethrough   =   0   'False
  191.          EndProperty
  192.          ForeColor       =   &H00FF0000&
  193.          Height          =   285
  194.          Left            =   2220
  195.          TabIndex        =   11
  196.          Top             =   780
  197.          Width           =   2265
  198.       End
  199.       Begin VB.Label Label1 
  200.          Appearance      =   0  'Flat
  201.          BackColor       =   &H80000005&
  202.          BackStyle       =   0  'Transparent
  203.          Caption         =   "会计年度:"
  204.          BeginProperty Font 
  205.             Name            =   "MS Sans Serif"
  206.             Size            =   8.25
  207.             Charset         =   0
  208.             Weight          =   400
  209.             Underline       =   0   'False
  210.             Italic          =   0   'False
  211.             Strikethrough   =   0   'False
  212.          EndProperty
  213.          ForeColor       =   &H80000008&
  214.          Height          =   195
  215.          Index           =   2
  216.          Left            =   1140
  217.          TabIndex        =   10
  218.          Top             =   780
  219.          Width           =   795
  220.       End
  221.       Begin VB.Label Lab_TitleText 
  222.          BackStyle       =   0  'Transparent
  223.          BeginProperty Font 
  224.             Name            =   "MS Sans Serif"
  225.             Size            =   8.25
  226.             Charset         =   0
  227.             Weight          =   400
  228.             Underline       =   0   'False
  229.             Italic          =   0   'False
  230.             Strikethrough   =   0   'False
  231.          EndProperty
  232.          ForeColor       =   &H00FF0000&
  233.          Height          =   225
  234.          Left            =   750
  235.          TabIndex        =   9
  236.          Top             =   690
  237.          Width           =   1455
  238.       End
  239.       Begin VB.Label tsLabel 
  240.          BackColor       =   &H80000018&
  241.          BackStyle       =   0  'Transparent
  242.          Caption         =   "科目预算表"
  243.          BeginProperty Font 
  244.             Name            =   "宋体"
  245.             Size            =   12
  246.             Charset         =   134
  247.             Weight          =   700
  248.             Underline       =   0   'False
  249.             Italic          =   0   'False
  250.             Strikethrough   =   0   'False
  251.          EndProperty
  252.          ForeColor       =   &H00000000&
  253.          Height          =   315
  254.          Index           =   4
  255.          Left            =   570
  256.          TabIndex        =   8
  257.          Top             =   210
  258.          Width           =   2655
  259.       End
  260.    End
  261.    Begin VB.TextBox Ydtext 
  262.       BackColor       =   &H00C0FFFF&
  263.       BorderStyle     =   0  'None
  264.       BeginProperty Font 
  265.          Name            =   "MS Sans Serif"
  266.          Size            =   8.25
  267.          Charset         =   0
  268.          Weight          =   400
  269.          Underline       =   0   'False
  270.          Italic          =   0   'False
  271.          Strikethrough   =   0   'False
  272.       EndProperty
  273.       Height          =   330
  274.       Left            =   8310
  275.       MultiLine       =   -1  'True
  276.       TabIndex        =   0
  277.       Top             =   3690
  278.       Visible         =   0   'False
  279.       Width           =   1185
  280.    End
  281.    Begin VB.ComboBox YdCombo 
  282.       BeginProperty Font 
  283.          Name            =   "MS Sans Serif"
  284.          Size            =   8.25
  285.          Charset         =   0
  286.          Weight          =   400
  287.          Underline       =   0   'False
  288.          Italic          =   0   'False
  289.          Strikethrough   =   0   'False
  290.       EndProperty
  291.       Height          =   300
  292.       Left            =   8310
  293.       Style           =   2  'Dropdown List
  294.       TabIndex        =   3
  295.       Top             =   4110
  296.       Visible         =   0   'False
  297.       Width           =   1155
  298.    End
  299.    Begin VB.Timer Timer1 
  300.       Interval        =   1
  301.       Left            =   8310
  302.       Top             =   2970
  303.    End
  304.    Begin VSFlex8Ctl.VSFlexGrid WglrGrid 
  305.       Height          =   6225
  306.       Left            =   0
  307.       TabIndex        =   4
  308.       Top             =   1710
  309.       Width           =   11775
  310.       _cx             =   5080
  311.       _cy             =   5080
  312.       Appearance      =   1
  313.       BorderStyle     =   1
  314.       Enabled         =   -1  'True
  315.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  316.          Name            =   "宋体"
  317.          Size            =   9
  318.          Charset         =   134
  319.          Weight          =   400
  320.          Underline       =   0   'False
  321.          Italic          =   0   'False
  322.          Strikethrough   =   0   'False
  323.       EndProperty
  324.       MousePointer    =   0
  325.       BackColor       =   16777215
  326.       ForeColor       =   -2147483640
  327.       BackColorFixed  =   12632256
  328.       ForeColorFixed  =   -2147483630
  329.       BackColorSel    =   -2147483635
  330.       ForeColorSel    =   -2147483634
  331.       BackColorBkg    =   -2147483636
  332.       BackColorAlternate=   16777215
  333.       GridColor       =   -2147483633
  334.       GridColorFixed  =   -2147483632
  335.       TreeColor       =   -2147483632
  336.       FloodColor      =   192
  337.       SheetBorder     =   -2147483642
  338.       FocusRect       =   1
  339.       HighLight       =   1
  340.       AllowSelection  =   -1  'True
  341.       AllowBigSelection=   -1  'True
  342.       AllowUserResizing=   0
  343.       SelectionMode   =   0
  344.       GridLines       =   1
  345.       GridLinesFixed  =   2
  346.       GridLineWidth   =   1
  347.       Rows            =   50
  348.       Cols            =   10
  349.       FixedRows       =   1
  350.       FixedCols       =   1
  351.       RowHeightMin    =   0
  352.       RowHeightMax    =   0
  353.       ColWidthMin     =   0
  354.       ColWidthMax     =   0
  355.       ExtendLastCol   =   0   'False
  356.       FormatString    =   ""
  357.       ScrollTrack     =   0   'False
  358.       ScrollBars      =   3
  359.       ScrollTips      =   0   'False
  360.       MergeCells      =   0
  361.       MergeCompare    =   0
  362.       AutoResize      =   -1  'True
  363.       AutoSizeMode    =   0
  364.       AutoSearch      =   0
  365.       AutoSearchDelay =   2
  366.       MultiTotals     =   -1  'True
  367.       SubtotalPosition=   1
  368.       OutlineBar      =   0
  369.       OutlineCol      =   0
  370.       Ellipsis        =   0
  371.       ExplorerBar     =   0
  372.       PicturesOver    =   0   'False
  373.       FillStyle       =   0
  374.       RightToLeft     =   0   'False
  375.       PictureType     =   0
  376.       TabBehavior     =   0
  377.       OwnerDraw       =   0
  378.       Editable        =   0
  379.       ShowComboButton =   1
  380.       WordWrap        =   0   'False
  381.       TextStyle       =   0
  382.       TextStyleFixed  =   0
  383.       OleDragMode     =   0
  384.       OleDropMode     =   0
  385.       DataMode        =   0
  386.       VirtualData     =   -1  'True
  387.       DataMember      =   ""
  388.       ComboSearch     =   3
  389.       AutoSizeMouse   =   -1  'True
  390.       FrozenRows      =   0
  391.       FrozenCols      =   0
  392.       AllowUserFreezing=   0
  393.       BackColorFrozen =   0
  394.       ForeColorFrozen =   0
  395.       WallPaperAlignment=   9
  396.       AccessibleName  =   ""
  397.       AccessibleDescription=   ""
  398.       AccessibleValue =   ""
  399.       AccessibleRole  =   24
  400.    End
  401.    Begin MSComctlLib.Toolbar Tlb_Action 
  402.       Align           =   1  'Align Top
  403.       Height          =   555
  404.       Left            =   0
  405.       TabIndex        =   2
  406.       Top             =   0
  407.       Width           =   11400
  408.       _ExtentX        =   20108
  409.       _ExtentY        =   979
  410.       ButtonWidth     =   820
  411.       ButtonHeight    =   926
  412.       AllowCustomize  =   0   'False
  413.       Wrappable       =   0   'False
  414.       Appearance      =   1
  415.       Style           =   1
  416.       ImageList       =   "ImageList1"
  417.       _Version        =   393216
  418.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  419.          NumButtons      =   10
  420.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  421.             Caption         =   "设置"
  422.             Key             =   "ymsz"
  423.             Object.ToolTipText     =   "打印页面设置"
  424.             ImageKey        =   "sz"
  425.          EndProperty
  426.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  427.             Caption         =   "打印"
  428.             Key             =   "dy"
  429.             Object.ToolTipText     =   "打印当前单据或Ctrl+P"
  430.             ImageKey        =   "dy"
  431.          EndProperty
  432.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  433.             Caption         =   "预览"
  434.             Key             =   "yl"
  435.             ImageKey        =   "yl"
  436.          EndProperty
  437.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  438.             Style           =   3
  439.          EndProperty
  440.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  441.             Caption         =   "删行"
  442.             Key             =   "sh"
  443.             Object.ToolTipText     =   "删除当前记录行或Delete"
  444.             ImageKey        =   "sh"
  445.          EndProperty
  446.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  447.             Style           =   3
  448.          EndProperty
  449.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  450.             Caption         =   "导入"
  451.             Key             =   "dr"
  452.             Description     =   "导入上年数据"
  453.             Object.ToolTipText     =   "导入上年数据"
  454.             ImageKey        =   "zd"
  455.          EndProperty
  456.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  457.             Style           =   3
  458.          EndProperty
  459.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  460.             Caption         =   "帮助"
  461.             Key             =   "bz"
  462.             ImageKey        =   "bz"
  463.          EndProperty
  464.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  465.             Caption         =   "退出"
  466.             Key             =   "fh"
  467.             ImageKey        =   "tc"
  468.          EndProperty
  469.       EndProperty
  470.       BorderStyle     =   1
  471.       Begin MSComctlLib.Toolbar GsToolbar 
  472.          Height          =   525
  473.          Left            =   9720
  474.          TabIndex        =   6
  475.          Top             =   0
  476.          Width           =   1695
  477.          _ExtentX        =   2990
  478.          _ExtentY        =   926
  479.          ButtonWidth     =   1455
  480.          ButtonHeight    =   926
  481.          AllowCustomize  =   0   'False
  482.          Appearance      =   1
  483.          Style           =   1
  484.          ImageList       =   "ImageList1"
  485.          _Version        =   393216
  486.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  487.             NumButtons      =   2
  488.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  489.                Caption         =   "保存格式"
  490.                Key             =   "bcgs"
  491.                ImageKey        =   "bcgs"
  492.             EndProperty
  493.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  494.                Caption         =   "默认列宽"
  495.                Key             =   "hfmrgs"
  496.                ImageKey        =   "mrlk"
  497.             EndProperty
  498.          EndProperty
  499.       End
  500.    End
  501.    Begin VB.Label Lab_OperStatus 
  502.       BackColor       =   &H000080FF&
  503.       Caption         =   "1"
  504.       BeginProperty Font 
  505.          Name            =   "MS Sans Serif"
  506.          Size            =   8.25
  507.          Charset         =   0
  508.          Weight          =   400
  509.          Underline       =   0   'False
  510.          Italic          =   0   'False
  511.          Strikethrough   =   0   'False
  512.       EndProperty
  513.       Height          =   345
  514.       Left            =   10980
  515.       TabIndex        =   5
  516.       Top             =   1230
  517.       Visible         =   0   'False
  518.       Width           =   345
  519.    End
  520. End
  521. Attribute VB_Name = "YS_FrmAccntBudget"
  522. Attribute VB_GlobalNameSpace = False
  523. Attribute VB_Creatable = False
  524. Attribute VB_PredeclaredId = True
  525. Attribute VB_Exposed = False
  526. '**************************************************************************************************
  527. '*    模 块 名 称 :科目预算表
  528. '*    功 能 描 述 :对所进行预算的会计科目的预算金额录入
  529. '*    程序员姓名  :魏永生
  530. '*    最后修改人  :
  531. '*    最后修改时间:2002/01/21
  532. '*    备        注:程序中所有依实际情况自定义部分均用[>> <<]括起
  533. '*
  534. '*    1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
  535. '*    2.网格列存储内容注解
  536. '*      0-行有效标识 1-记录编辑唯一标识 2-科目编码
  537. '*    3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) 1-浏览 2-修改
  538. '**************************************************************************************************
  539.     
  540.  '以下为固定使用变量(网格)
  541. Dim Cxnrrec As New ADODB.Recordset              '显示查询内容动态集
  542. Dim Dyymctbl As New DY_Dyymsz                   '打印页面窗体变量
  543. Dim GridCode As String                          '显示网格网格代码
  544. Dim GridInf() As Variant                        '整个网格设置信息
  545. Dim ReportTitle As String                       '报表主标题
  546. Dim Tsxx As String                              '系统提示信息
  547. Dim Pmbcsjhs As Long                            '屏幕网格保持数据行数(大于等于1)
  548. Dim Fzxwghs As Integer                          '辅助项网格行数(包括合计行)
  549. Dim Sfxshjwg As Boolean                         '是否显示合计网格
  550. Dim Qslz As Long                                '网格隐藏(非操作显示)列数
  551. Dim Sjhgd As Double                             '网格数据行高度
  552. Dim GridBoolean() As Boolean                    '网格列信息(布尔型)
  553. Dim GridStr()  As String                        '网格列信息(字符型)
  554. Dim GridInt() As Integer                        '网格列信息(整型)
  555. Dim Sfblbzkd As Boolean                         '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
  556. Dim Dqlrwgh As Long                             '当前录入数据网格行
  557. Dim Dqlrwgl As Long                             '当前录入数据网格列
  558. Dim Dqlkwgh As Long                             '刚刚离开网格行(不一定为录入行)
  559. Dim Dqlkwgl As Long                             '刚刚离开网格列
  560. Dim Dqtoprow As Long                            '当前录入状态时最上端可视行
  561. Dim Dqleftcol As Long                           '当前录入状态时最左端可视列
  562. Dim Zdlrqnr As String                           '字段录入修改前内容(用来判断内容是否修改)
  563. Dim Wbkbhlock As Boolean                        '文本框改变值锁
  564. Dim changelock As Boolean                       '网格行列改变控制锁(用来区别用户改变.程序改变)
  565. Dim Gdtlock As Boolean                          '滚动条滚动控制(用来区别用户改变.程序改变)
  566. Dim Yxxpdlock As Boolean                        '字段有效性判断锁(内容不修改不需进行字段有效性判断)
  567. Dim Hyxxpdlock As Boolean                       '行有效性判断锁(字段内容不修改不需进行行有效性判断)
  568. Dim Valilock As Boolean                         '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
  569. Dim Shsfts As Boolean                           '删除记录行是否提示
  570. Dim Szzls As Integer                            '网格信息数组最大下标值(网格列数-1)
  571. Private Sub Form_KeyPress(KeyAscii As Integer)      '控制焦点转移和限制录入字符"'"
  572.     Select Case KeyAscii
  573.     Case 39           '屏蔽字符"'"
  574.         KeyAscii = 0
  575.     End Select
  576. End Sub
  577. Private Sub Form_Load()                             '窗 体 装 入
  578.     Dim RecTemp As New ADODB.Recordset              '临时使用动态集
  579.                                                     '隐藏选择对话框
  580.                                                     '提示标签
  581.     lbl_AccountYear.Caption = Str(Int_OriYear)
  582.     
  583.     YS_FrmAccntBudgetC.Hide
  584.     
  585.     
  586.     '初始化各种锁值
  587.     changelock = False             '网格行列改变控制锁
  588.     Gdtlock = False                '滚动条滚动控制
  589.     Yxxpdlock = True               '字段有效性判断锁
  590.     Hyxxpdlock = True              '行有效性判断锁
  591.     Wbkbhlock = False              '文本框内容改变锁
  592.     
  593.     '报表主标题及报表编码
  594.     ReportTitle = "科目预算表"
  595.     XtReportCode = "cwfx_Budget"
  596.     Load Dyymctbl
  597.     
  598.     '调 入 网 格
  599.     GridCode = "cwfx_Budget"      '网格属性编码
  600.     Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  601.     
  602.     Qslz = GridInf(1)
  603.     Sjhgd = GridInf(2)
  604.     Pmbcsjhs = GridInf(3)
  605.     Fzxwghs = GridInf(4)
  606.     Sfblbzkd = GridInf(5)
  607.     Shsfts = GridInf(6)
  608.     Sfxshjwg = GridInf(7)
  609.     Szzls = WglrGrid.Cols - 1
  610.     
  611.     '生成查询结果
  612.     Call Sub_Query
  613.     
  614.     '设置状态为修改状态
  615.     Lab_OperStatus = "2"
  616.     
  617. End Sub
  618. Private Sub Form_Unload(Cancel As Integer)           '窗体卸载
  619.     
  620.     '卸载打印页面窗体
  621.     Unload Dyymctbl
  622.     Unload YS_FrmAccntBudgetC
  623.     
  624. End Sub
  625. Private Sub Sub_Query()                    '生成查询结果
  626.     Dim SqlStr As String                   '查询字符串
  627.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  628.     Dim Jsqte  As Long                     '临时计数器
  629.     
  630.     SqlStr = "SELECT Cwfx_AccountBudgetMaster.*,CName FROM Cwfx_AccountBudgetMaster,Cwzz_AccCode "
  631.     SqlStr = SqlStr + " where Cwfx_AccountBudgetMaster.CCode=Cwzz_AccCode.CCode And Year=" & Str(Int_OriYear)
  632.     SqlStr = SqlStr + " order by Cwfx_AccountBudgetMaster.Ccode "
  633.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  634.     
  635.     With RecTemp
  636.         
  637.         WglrGrid.Clear 1
  638.         
  639.         WglrGrid.Rows = .RecordCount + WglrGrid.FixedRows
  640.         
  641.         Jsqte = WglrGrid.FixedRows
  642.         Do While Not .EOF
  643.             If Jsqte >= WglrGrid.Rows Then
  644.                 WglrGrid.AddItem ""
  645.             End If
  646.             
  647.             WglrGrid.TextMatrix(Jsqte, 0) = "*"                                                              '有效记录标识
  648.             WglrGrid.TextMatrix(Jsqte, 1) = Trim(.Fields("I_id"))            '记录唯一标识
  649.             WglrGrid.TextMatrix(Jsqte, 2) = Trim(.Fields("CCode"))
  650.             
  651.             WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Cname"))
  652.             WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = IIf(.Fields("Budget_1") = 0, "", .Fields("budget_1"))
  653.             WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = IIf(.Fields("Add_1") = 0, "", .Fields("Add_1"))
  654.             WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = IIf(.Fields("Budget_2") = 0, "", .Fields("budget_2"))
  655.             WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = IIf(.Fields("Add_2") = 0, "", .Fields("Add_2"))
  656.             WglrGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = IIf(.Fields("Budget_3") = 0, "", .Fields("budget_3"))
  657.             WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = IIf(.Fields("Add_3") = 0, "", .Fields("Add_3"))
  658.             WglrGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = IIf(.Fields("Budget_4") = 0, "", .Fields("budget_4"))
  659.             WglrGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = IIf(.Fields("Add_4") = 0, "", .Fields("Add_4"))
  660.             WglrGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = IIf(.Fields("Budget_5") = 0, "", .Fields("budget_5"))
  661.             WglrGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = IIf(.Fields("Add_5") = 0, "", .Fields("Add_5"))
  662.             WglrGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = IIf(.Fields("Budget_6") = 0, "", .Fields("budget_6"))
  663.             WglrGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = IIf(.Fields("Add_6") = 0, "", .Fields("Add_6"))
  664.             WglrGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = IIf(.Fields("Budget_7") = 0, "", .Fields("budget_7"))
  665.             WglrGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = IIf(.Fields("Add_7") = 0, "", .Fields("Add_7"))
  666.             WglrGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = IIf(.Fields("Budget_8") = 0, "", .Fields("budget_8"))
  667.             WglrGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = IIf(.Fields("Add_8") = 0, "", .Fields("Add_8"))
  668.             WglrGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = IIf(.Fields("Budget_9") = 0, "", .Fields("budget_9"))
  669.             WglrGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = IIf(.Fields("Add_9") = 0, "", .Fields("Add_9"))
  670.             WglrGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = IIf(.Fields("Budget_10") = 0, "", .Fields("budget_10"))
  671.             WglrGrid.TextMatrix(Jsqte, Sydz("021", GridStr(), Szzls)) = IIf(.Fields("Add_10") = 0, "", .Fields("Add_10"))
  672.             WglrGrid.TextMatrix(Jsqte, Sydz("022", GridStr(), Szzls)) = IIf(.Fields("Budget_11") = 0, "", .Fields("budget_11"))
  673.             WglrGrid.TextMatrix(Jsqte, Sydz("023", GridStr(), Szzls)) = IIf(.Fields("Add_11") = 0, "", .Fields("Add_11"))
  674.             WglrGrid.TextMatrix(Jsqte, Sydz("024", GridStr(), Szzls)) = IIf(.Fields("Budget_12") = 0, "", .Fields("budget_12"))
  675.             WglrGrid.TextMatrix(Jsqte, Sydz("025", GridStr(), Szzls)) = IIf(.Fields("Add_12") = 0, "", .Fields("Add_12"))
  676.             
  677.             Cur_SumBudget = .Fields("Budget_1") + .Fields("Budget_2") + .Fields("Budget_3") + .Fields("Budget_4") + _
  678.             .Fields("Budget_5") + .Fields("Budget_6") + .Fields("Budget_7") + .Fields("Budget_8") + _
  679.             .Fields("Budget_9") + .Fields("Budget_10") + .Fields("Budget_11") + .Fields("Budget_12") + _
  680.             .Fields("Add_1") + .Fields("Add_2") + .Fields("Add_3") + .Fields("Add_4") + .Fields("Add_5") + _
  681.             .Fields("Add_6") + .Fields("Add_7") + .Fields("Add_8") + .Fields("Add_9") + .Fields("Add_10") + _
  682.             .Fields("Add_11") + .Fields("Add_12")
  683.             WglrGrid.TextMatrix(Jsqte, Sydz("026", GridStr(), Szzls)) = IIf(Cur_SumBudget = 0, "", Cur_SumBudget)
  684.             
  685.             
  686.             WglrGrid.TextMatrix(Jsqte, Sydz("027", GridStr(), Szzls)) = IIf(.Fields("YearBudget") = 0, "", .Fields("YearBudget"))
  687.             
  688.             '<<]
  689.             WglrGrid.RowHeight(Jsqte) = Sjhgd
  690.             .MoveNext
  691.             Jsqte = Jsqte + 1
  692.         Loop
  693.     End With
  694.     
  695.     '调整网格
  696.     Call Sub_AdjustGrid
  697.     
  698. End Sub
  699. Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)             '用户点击工具条
  700.     Dim Msg, Style, Title, Response
  701.     
  702.     '屏蔽文本框,下拉组合框有效性判断
  703.     
  704.     Valilock = True
  705.     
  706.     '屏蔽网格失去焦点产生的有效性判断
  707.     
  708.     changelock = True
  709.     
  710.     Select Case Button.Key
  711.     Case "ymsz"                                          '页面设置
  712.         Dyymctbl.Show 1
  713.     Case "yl"                                            '预 览
  714.         If Fun_Drfrmyxxpd Then
  715.             Call bbyl(True)
  716.         End If
  717.     Case "dy"                                            '打 印
  718.         If Fun_Drfrmyxxpd Then
  719.             Call bbyl(False)
  720.         End If
  721.     Case "sh"                                            '删 行
  722.         Call Scdqfl
  723.     
  724.     Case "dr"                                            '导入
  725.         Msg = "导入将替换本年已录入的相同科目的预算数据?"   ' 定义信息。
  726.         Style = vbYesNo + vbDefaultButton2 + vbExclamation ' 定义按钮。
  727.         Title = "百利/ERP财务分析系统5.0"   ' 定义标题。
  728.         Response = MsgBox(Msg, Style, Title)
  729.         If Response = vbYes Then   ' 用户按下“是”。
  730.             Call ImportFromLastYear
  731.            
  732.         End If
  733.         
  734.     Case "bz"                                            '帮 助
  735.         Call F1bz
  736.     Case "fh"                                            '退 出
  737.         Unload Me
  738.     End Select
  739.     
  740.     '解 锁
  741.     Valilock = False
  742.     changelock = False
  743.     
  744. End Sub
  745. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  746.     If Shift = 2 Then
  747.         Select Case UCase(Chr(KeyCode))
  748.         Case "P"                   'Ctrl+P 打印
  749.             If Tlb_Action.Buttons("dy").Enabled Then
  750.                 Call bbyl(False)
  751.             End If
  752.         End Select
  753.     End If
  754. End Sub
  755. Private Sub Wbkcl()                                                 '文本框录入之前处理(根据实际情况)
  756.     Dim xswbrr As String
  757.     With WglrGrid
  758.         Zdlrqnr = Trim(.Text)
  759.         xswbrr = Trim(.Text)
  760.         
  761.         If GridBoolean(.Col, 3) Then   '列表框录入
  762.             
  763.             '填充列表框程序
  764.             Call FillCombo(YdCombo, GridStr(.Col, 5), xswbrr, 0)
  765.         Else
  766.             Wbkbhlock = True
  767.             
  768.             '====以下为用户自定义
  769.             Ydtext.Text = xswbrr
  770.             '====以上为用户自定义
  771.             
  772.             Wbkbhlock = False
  773.             Ydtext.SelStart = Len(Ydtext.Text)
  774.         End If
  775.     End With
  776. End Sub
  777. Private Function sjzdyxxpd(Dqpdwgh As Long, Dqpdwgl As Long)        '录入数据字段有效性判断,同时进行字段录入事后处理
  778.     Dim Str_JudgeText As String  '临时有效性判断字段内容
  779.     Dim Coljsq As Long           '临时列计数器
  780.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  781.     Dim Dbl_Qcye As Double                 '临时期初余额
  782.     
  783.     With WglrGrid
  784.         
  785.         '非录入状态有效性为合法
  786.         If Yxxpdlock Or .Row < .FixedRows Then
  787.             sjzdyxxpd = True
  788.             Exit Function
  789.         End If
  790.         
  791.         Str_JudgeText = Trim(.TextMatrix(Dqpdwgh, Dqpdwgl))
  792.         Select Case GridStr(Dqpdwgl, 1)
  793.             
  794.                                                 '以下为自定义部分[
  795.                                                 '1.放置字段有效性判断程序
  796.         Case "001"                              '科目(如有效则调入科目编码)
  797.             If Len(Str_JudgeText) <> 0 Then
  798.                 SqlStr = "Select * FROM Cwzz_AccCode Where CCode='" & Str_JudgeText & "' OR CName='" & Str_JudgeText & "'"
  799.                 Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  800.                 With RecTemp
  801.                     If .EOF Then
  802.                         Tsxx = "此科目不存在!"
  803.                         GoTo Lrcwcl
  804.                     End If
  805.                     
  806.                                                 '1.如果科目存在则存储相应预算科目编码
  807.                     
  808.                     WglrGrid.TextMatrix(Dqpdwgh, 2) = Trim(RecTemp.Fields("CCode"))
  809.                     WglrGrid.TextMatrix(Dqpdwgh, Sydz("001", GridStr(), Szzls)) = Trim(RecTemp.Fields("CName"))
  810.                     
  811.                 End With
  812.                 
  813.                                                 '判断记录是否重复
  814.                 SqlStr = "SELECT Cwfx_AccountBudgetMaster.I_id From Cwfx_AccountBudgetMaster WHERE Ccode='" & WglrGrid.TextMatrix(Dqpdwgh, 2) & "'And Year=" & Str(Int_OriYear)
  815.                 Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  816.                 If Not RecTemp.EOF Then
  817.                     If RecTemp.Fields("I_ID") <> Val(WglrGrid.TextMatrix(Dqpdwgh, 1)) Then
  818.                         Tsxx = "录入记录重复!"
  819.                         Dqpdwgl = Sydz("001", GridStr(), Szzls)
  820.                         GoTo Lrcwcl
  821.                     End If
  822.                 End If
  823.                 
  824.             Else
  825.                 WglrGrid.TextMatrix(Dqpdwgh, Sydz("001", GridStr(), Szzls)) = ""
  826.             End If
  827.             
  828.             '2.放置字段事后处理程序
  829.             '科目所要进行核算项不能为空
  830.             If (Not .ColHidden(Sydz("001", GridStr(), Szzls))) And Trim(.TextMatrix(Dqpdwgh, Sydz("001", GridStr(), Szzls))) = "" Then
  831.                 Tsxx = "预算项目不能为空!"
  832.                 Lrywlz = Sydz("001", GridStr(), Szzls)
  833.                 GoTo Lrcwcl
  834.             End If
  835.            
  836.             '以上为自定义部分]
  837.             
  838.         End Select
  839.         '2.放置字段事后处理程序
  840.         Cur_SumBudget = 0
  841.         For I = 2 To 25
  842.             Cur_SumBudget = Cur_SumBudget + Val(WglrGrid.TextMatrix(Dqpdwgh, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)))
  843.         Next
  844.         WglrGrid.TextMatrix(Dqpdwgh, Sydz("026", GridStr(), Szzls)) = IIf(Cur_SumBudget = 0, "", Cur_SumBudget)
  845.         
  846.         
  847.         '字段录入正确后为零字段清空
  848.         Call Qkwlzd(Dqpdwgh, Dqpdwgl)
  849.         
  850.         sjzdyxxpd = True
  851.         Yxxpdlock = True
  852.         Exit Function
  853.     End With
  854.     
  855. Lrcwcl:    '录入错误处理
  856.     With WglrGrid
  857.         Call Xtxxts(Tsxx, 0, 1)
  858.         changelock = True
  859.         .Select Dqpdwgh, Dqpdwgl
  860.         changelock = False
  861.         Call xswbk
  862.         sjzdyxxpd = False
  863.         Exit Function
  864.     End With
  865. End Function
  866. Private Function Sjhzyxxpd(ByVal Yxxpdh As Long) As Boolean                  '录入数据行有效性判断,同时进行行处理
  867.     Dim Lrywlz As Long
  868.     Dim RecTemp As New ADODB.Recordset             '临时使用动态集
  869.     Dim SqlStr As String                           '临时连接字符串
  870.     Dim Rec_AccSumAssi As New ADODB.Recordset      '辅助总帐动态集
  871.     Dim Dbl_Now(1 To 16) As Double                 '科目记录现数据
  872.     Dim Str_OriItemCode As String                  '辅助核算项目编码(原)
  873.     Dim Str_NowItemCode As String                  '辅助核算项目编码(现)
  874.     
  875.     With WglrGrid
  876.         
  877.         '判断行为空和无效数据行则清除当前行
  878.         If Yxxpdh > (.Rows - .FixedRows) Then Exit Function
  879.         If .TextMatrix(Yxxpdh, 0) <> "*" Then
  880.             Sjhzyxxpd = True
  881.             Exit Function
  882.         Else
  883.             If pdhwk(Yxxpdh) And Yxxpdh + 1 <= .Rows - 1 Then
  884.                 If .TextMatrix(Yxxpdh + 1, 0) <> "*" Then
  885.                     changelock = True
  886.                     .RemoveItem Yxxpdh
  887.                     If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  888.                         .AddItem ""
  889.                         .RowHeight(.Rows - 1) = Sjhgd
  890.                     End If
  891.                     changelock = False
  892.                     Sjhzyxxpd = True
  893.                     Exit Function
  894.                 End If
  895.             End If
  896.         End If
  897.         
  898.         '行没有发生变化则不进行有效性判断
  899.         If Hyxxpdlock Then
  900.             Sjhzyxxpd = True
  901.             Exit Function
  902.         End If
  903.         
  904.         '以下为自定义部分[
  905.         
  906.         '1.放置行有效性判断程序
  907.         
  908.         '首先进行为空判断(固定不变)
  909.         For Jsqte = Qslz To .Cols - 1
  910.             If (GridInt(Jsqte, 5) = 1 And Len(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Or (GridInt(Jsqte, 5) = 2 And Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Then
  911.                 Tsxx = GridStr(Jsqte, 2)
  912.                 Lrywlz = Jsqte
  913.                 GoTo Lrcwcl
  914.                 Exit For
  915.             End If
  916.         Next Jsqte
  917.         
  918.         '科目所要进行核算项不能为空
  919.         If (Not .ColHidden(Sydz("001", GridStr(), Szzls))) And Trim(.TextMatrix(Yxxpdh, Sydz("001", GridStr(), Szzls))) = "" Then
  920.             Tsxx = "预算科目不能为空!"
  921.             Lrywlz = Sydz("001", GridStr(), Szzls)
  922.             GoTo Lrcwcl
  923.         End If
  924.         
  925.         '判断记录是否重复
  926.         SqlStr = "SELECT Cwfx_AccountBudgetMaster.I_id From Cwfx_AccountBudgetMaster WHERE Ccode='" & WglrGrid.TextMatrix(Yxxpdh, 2) & "'And Year=" & Str(Int_OriYear)
  927.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  928.         If Not RecTemp.EOF Then
  929.             If RecTemp.Fields("I_ID") <> Val(WglrGrid.TextMatrix(Yxxpdh, 1)) Then
  930.                 Tsxx = "录入记录重复!"
  931.                 For Jsqte = Qslz To WglrGrid.Cols - 1
  932.                     If Not WglrGrid.ColHidden(Jsqte) Then
  933.                         Lrywlz = Jsqte
  934.                     End If
  935.                 Next Jsqte
  936.                 Lrywlz = Sydz("001", GridStr(), Szzls)
  937.                 GoTo Lrcwcl
  938.             End If
  939.         End If
  940.         
  941.         '2.进行行数据回写
  942.         
  943.     End With
  944.     
  945.     On Error GoTo Swcwcl
  946.     
  947.     Cw_DataEnvi.DataConnect.BeginTrans
  948.     
  949.     With Rec_AccSumAssi
  950.         
  951.         If Val(Trim(WglrGrid.TextMatrix(Yxxpdh, 1))) <> 0 Then
  952.             If .State = 1 Then .Close
  953.             .Open "SELECT Cwfx_AccountBudgetMaster.* From Cwfx_AccountBudgetMaster WHERE I_id = " & Val(WglrGrid.TextMatrix(Yxxpdh, 1)), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  954.             
  955.             If Not .EOF Then
  956.                 .Fields("Ccode") = WglrGrid.TextMatrix(Yxxpdh, 2)                                            '预算科目
  957.                 .Fields("Year") = Int_OriYear                                           '会计年度
  958.                 .Fields("Budget_1") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls)))
  959.                 .Fields("Add_1") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("003", GridStr(), Szzls)))
  960.                 .Fields("Budget_2") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))
  961.                 .Fields("Add_2") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))
  962.                 .Fields("Budget_3") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("006", GridStr(), Szzls)))
  963.                 .Fields("Add_3") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls)))
  964.                 .Fields("Budget_4") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls)))
  965.                 .Fields("Add_4") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls)))
  966.                 .Fields("Budget_5") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("010", GridStr(), Szzls)))
  967.                 .Fields("Add_5") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("011", GridStr(), Szzls)))
  968.                 .Fields("Budget_6") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("012", GridStr(), Szzls)))
  969.                 .Fields("Add_6") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("013", GridStr(), Szzls)))
  970.                 .Fields("Budget_7") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("014", GridStr(), Szzls)))
  971.                 .Fields("Add_7") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("015", GridStr(), Szzls)))
  972.                 .Fields("Budget_8") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("016", GridStr(), Szzls)))
  973.                 .Fields("Add_8") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("017", GridStr(), Szzls)))
  974.                 .Fields("Budget_9") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("018", GridStr(), Szzls)))
  975.                 .Fields("Add_9") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("019", GridStr(), Szzls)))
  976.                 .Fields("Budget_10") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("020", GridStr(), Szzls)))
  977.                 .Fields("Add_10") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("021", GridStr(), Szzls)))
  978.                 .Fields("Budget_11") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("022", GridStr(), Szzls)))
  979.                 .Fields("Add_11") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("023", GridStr(), Szzls)))
  980.                 .Fields("Budget_12") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("024", GridStr(), Szzls)))
  981.                 .Fields("Add_12") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("025", GridStr(), Szzls)))
  982.                 
  983.                 .Fields("YearBudget") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("027", GridStr(), Szzls)))
  984.                 
  985.                 
  986.                 .Update
  987.                 
  988.                 '更新其他各会计期间数据
  989.                 
  990.             End If
  991.             
  992.         Else
  993.             If .State = 1 Then .Close
  994.             .Open "SELECT Cwfx_AccountBudgetMaster.* From Cwfx_AccountBudgetMaster WHERE I_id = " & Val(WglrGrid.TextMatrix(Yxxpdh, 1)), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  995.             
  996.             .AddNew
  997.             .Fields("Ccode") = Trim(WglrGrid.TextMatrix(Yxxpdh, 2))                                     '预算科目
  998.             .Fields("Year") = Int_OriYear                                          '会计年度
  999.             
  1000.             .Fields("Budget_1") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls)))
  1001.             .Fields("Add_1") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("003", GridStr(), Szzls)))
  1002.             .Fields("Budget_2") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))
  1003.             .Fields("Add_2") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))
  1004.             .Fields("Budget_3") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("006", GridStr(), Szzls)))
  1005.             .Fields("Add_3") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls)))
  1006.             .Fields("Budget_4") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls)))
  1007.             .Fields("Add_4") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls)))
  1008.             .Fields("Budget_5") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("010", GridStr(), Szzls)))
  1009.             .Fields("Add_5") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("011", GridStr(), Szzls)))
  1010.             .Fields("Budget_6") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("012", GridStr(), Szzls)))
  1011.             .Fields("Add_6") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("013", GridStr(), Szzls)))
  1012.             .Fields("Budget_7") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("014", GridStr(), Szzls)))
  1013.             .Fields("Add_7") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("015", GridStr(), Szzls)))
  1014.             .Fields("Budget_8") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("016", GridStr(), Szzls)))
  1015.             .Fields("Add_8") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("017", GridStr(), Szzls)))
  1016.             .Fields("Budget_9") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("018", GridStr(), Szzls)))
  1017.             .Fields("Add_9") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("019", GridStr(), Szzls)))
  1018.             .Fields("Budget_10") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("020", GridStr(), Szzls)))
  1019.             .Fields("Add_10") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("021", GridStr(), Szzls)))
  1020.             .Fields("Budget_11") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("022", GridStr(), Szzls)))
  1021.             .Fields("Add_11") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("023", GridStr(), Szzls)))
  1022.             .Fields("Budget_12") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("024", GridStr(), Szzls)))
  1023.             .Fields("Add_12") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("025", GridStr(), Szzls)))
  1024.             
  1025.             .Fields("YearBudget") = Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("027", GridStr(), Szzls)))
  1026.             
  1027.             
  1028.             .Update
  1029.             
  1030.             WglrGrid.TextMatrix(Yxxpdh, 1) = .Fields("I_id")
  1031.             
  1032.             
  1033.         End If
  1034.         
  1035.     End With
  1036.     
  1037.     Cw_DataEnvi.DataConnect.CommitTrans
  1038.     
  1039.     ' <<]
  1040.     
  1041.     '以上为自定义部分]
  1042.     
  1043.     Sjhzyxxpd = True
  1044.     Hyxxpdlock = True
  1045.     Exit Function
  1046.     
  1047. Swcwcl:
  1048.     Cw_DataEnvi.DataConnect.RollbackTrans
  1049.     Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
  1050.     Call Xtxxts(Tsxx, 0, 1)
  1051.     Exit Function
  1052.     
  1053. Lrcwcl:      '录入错误处理
  1054.     With WglrGrid
  1055.         Call Xtxxts(Tsxx, 0, 1)
  1056.         changelock = True
  1057.         .Select Yxxpdh, Lrywlz
  1058.         changelock = False
  1059.         Call xswbk
  1060.         
  1061.         Sjhzyxxpd = False
  1062.         Exit Function
  1063.     End With
  1064. End Function
  1065. '===================以 下 程 序 为 通 用 部 分 ,一 般 不 需 更 改======================='
  1066. Private Sub Sub_AdjustGrid()
  1067.     '调 整 网 格
  1068.     With WglrGrid
  1069.         '加 1 保持一行录入行
  1070.         If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1071.             .Rows = Pmbcsjhs + .FixedRows + Fzxwghs + 1
  1072.             For Jsqte = .FixedRows To .Rows - 1
  1073.                 .RowHeight(Jsqte) = Sjhgd
  1074.             Next Jsqte
  1075.         Else
  1076.             '判断是否有辅助行和录入行,如没有则加行
  1077.             Do While .TextMatrix(.Rows - 1 - Fzxwghs, 0) = "*"
  1078.                 .AddItem ""
  1079.                 .RowHeight(.Rows - 1) = Sjhgd
  1080.             Loop
  1081.         End If
  1082.     End With
  1083. End Sub
  1084. Private Sub Lrzdbz()                                                      '录入字段帮助
  1085.     If Not YdCommand.Visible Then
  1086.         Exit Sub
  1087.     End If
  1088.     Valilock = True
  1089.     With WglrGrid
  1090.         
  1091.         changelock = True        '调入另外窗体必须加锁
  1092.         If .Col = Sydz("001", GridStr(), Szzls) Then
  1093.             Call Drbmhelp(GridInt(.Col, 6), GridStr(.Col, 3), Trim(Ydtext.Text))
  1094.             Str_Ccode = Xtfhcs
  1095.         End If
  1096.         changelock = False
  1097.         If Len(Xtfhcs) <> 0 Then
  1098.             If GridInt(.Col, 7) = 0 Then
  1099.                 Ydtext.Text = Xtfhcs
  1100.             Else
  1101.                 Ydtext.Text = Xtfhcsfz
  1102.             End If
  1103.         End If
  1104.         
  1105.         Valilock = False
  1106.         If Ydtext.Visible Then
  1107.             Ydtext.SetFocus
  1108.         End If
  1109.     End With
  1110. End Sub
  1111. Private Sub Form_Resize()                                                '窗体大小发生变化时,重新显示文本框
  1112.     Call Cxxswbk
  1113. End Sub
  1114. Private Function Fun_Drfrmyxxpd() As Boolean                             '调入其它窗体或功能产生的有效性判断(包括数据回写)
  1115.     Fun_Drfrmyxxpd = True
  1116.     With WglrGrid
  1117.         
  1118.         '如果当前网格处于编辑状态,则先进行数据回写再进行有效性判断
  1119.         
  1120.         If Ydtext.Visible Or YdCombo.Visible Then
  1121.             Call Lrsjhx
  1122.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1123.                 Fun_Drfrmyxxpd = False
  1124.                 Exit Function
  1125.             End If
  1126.         End If
  1127.         
  1128.         '进行行有效性判断
  1129.         If Not Sjhzyxxpd(.Row) Then
  1130.             Fun_Drfrmyxxpd = False
  1131.             Exit Function
  1132.         End If
  1133.         
  1134.     End With
  1135. End Function
  1136. Private Sub WglrGrid_GotFocus()                                     '网格得到焦点
  1137.     
  1138.     '网格得到焦点,如果当前选择行为非数据行
  1139.     '则调整当前焦点至有效数据行
  1140.     
  1141.     With WglrGrid
  1142.         If .Row < .FixedRows And .Rows > .FixedRows Then
  1143.             changelock = True
  1144.             .Select .FixedRows, .Col
  1145.             changelock = False
  1146.         End If
  1147.         If .Col < Qslz Then
  1148.             changelock = True
  1149.             .Select .Row, Qslz
  1150.             changelock = False
  1151.         End If
  1152.     End With
  1153.     
  1154. End Sub
  1155. Private Sub WglrGrid_LostFocus()                                    '录入网格失去焦点
  1156.     
  1157.     '用以屏蔽调用其它窗体时发生网格失去焦点事件
  1158.     If changelock Then
  1159.         Exit Sub
  1160.     End If
  1161.     
  1162.     '引发网格RowcolChange事件
  1163.     With WglrGrid
  1164.         If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1165.             .Select 0, 0
  1166.         End If
  1167.     End With
  1168.     
  1169. End Sub
  1170. Private Sub WglrGrid_AfterScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)                                       '限制用户在录入过程中滚动鼠标
  1171.     
  1172.     If Gdtlock Then
  1173.         Exit Sub
  1174.     End If
  1175.     
  1176.     With WglrGrid
  1177.         If Ydtext.Visible Or YdCombo.Visible Then
  1178.             Gdtlock = True
  1179.             .TopRow = Dqtoprow
  1180.             .LeftCol = Dqleftcol
  1181.             Gdtlock = False
  1182.             Exit Sub
  1183.         End If
  1184.         
  1185.     End With
  1186. End Sub
  1187. Private Sub WglrGrid_LeaveCell()                                    '离开单元格
  1188.     If changelock Then
  1189.         Exit Sub
  1190.     End If
  1191.     
  1192.     '记录刚刚离开网格单元的行列值
  1193.     Dqlkwgh = WglrGrid.Row
  1194.     Dqlkwgl = WglrGrid.Col
  1195.     
  1196.     '判断是否需要录入数据回写
  1197.     If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1198.         Exit Sub
  1199.     End If
  1200.     Call Lrsjhx
  1201. End Sub
  1202. Private Sub WglrGrid_RowColChange()                                '网格录入行列发生变化时,进行有效性判断
  1203.     Valilock = True       '屏蔽文本框失去焦点进行有效性判断
  1204.     With WglrGrid
  1205.         If changelock Then
  1206.             Exit Sub
  1207.         End If
  1208.         If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1209.             Exit Sub
  1210.         End If
  1211.         If .Row <> Dqlkwgh Then
  1212.             If Not Sjhzyxxpd(Dqlkwgh) Then
  1213.                 Exit Sub
  1214.             End If
  1215.         End If
  1216.     End With
  1217.     Call fhyxh
  1218.     Call Xldql
  1219.     
  1220. End Sub
  1221. Private Sub WglrGrid_DblClick()          '鼠标双击网格显示文本框
  1222.     Dim I As Integer
  1223.     Dim Bln_Add As Boolean
  1224.     Dim CurrentRow As Integer
  1225.     Dim CurrentCol As Integer
  1226.     Let Bln_Add = False
  1227.     
  1228.     With WglrGrid
  1229.         '非数据行退出
  1230.         If .Row < .FixedRows Then
  1231.             Exit Sub
  1232.         End If
  1233.         
  1234.         For I = 3 To 25 Step 2                 '如果是追加列则取月份
  1235.             If .Col = Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls) Then
  1236.                 Bln_Add = True
  1237.                 Int_Month = Int(I / 2)
  1238.                 Exit For
  1239.             End If
  1240.         Next
  1241.         
  1242.         On Error GoTo Swcwcl1
  1243.         If Bln_Add Then                       '是追加列调用追加金额form
  1244.             Str_Show = "预算科目: " & Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls))) & "   会计年度: " & Trim(Str(Int_OriYear)) & "  月份: " & Trim(Str(Int_Month))
  1245.             Str_TableAdd = "cwfx_AccountBudgetSlaver"
  1246.             Int_I_Id = .TextMatrix(.Row, 1)
  1247.             Str_Title = "科目预算追加金额表"
  1248.             Str_ReportSubTitle = "预算科目: " & Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls))) & Space(10) + Fun_FormatOutPut("会计年度:" + Str(Int_OriYear), 30) & "  月份: " & Trim(Str(Int_Month))
  1249.             
  1250.             CurrentRow = .Row
  1251.             CurrentCol = .Col
  1252.             YS_FrmBudgetAdd.HelpContextID = "0411004003"
  1253.             YS_FrmBudgetAdd.Show 1
  1254.             .Row = CurrentRow
  1255.             .Col = CurrentCol
  1256.             
  1257.             .TextMatrix(.Row, .Col) = IIf(Cur_TableAdd = 0, "", Cur_TableAdd)   '金额回写单位格
  1258.             
  1259.             Cur_SumBudget = 0
  1260.             For I = 2 To 25
  1261.                 Cur_SumBudget = Cur_SumBudget + Val(.TextMatrix(.Row, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)))
  1262.             Next
  1263.             .TextMatrix(.Row, Sydz("026", GridStr(), Szzls)) = IIf(Cur_SumBudget = 0, "", Cur_SumBudget)
  1264.             
  1265.             
  1266.             Hyxxpdlock = False
  1267.             
  1268.         Else
  1269.             Call xswbk
  1270.         End If
  1271.         
  1272.     End With
  1273.     Exit Sub
  1274.     
  1275. Swcwcl1:
  1276.     Tsxx = "先确认本次预算金额的录入才能录入追加金额!"
  1277.     Call Xtxxts(Tsxx, 0, 1)
  1278. End Sub
  1279. Private Sub Ycwbk()                      '隐藏文本框,帮助按钮,列表组合框
  1280.     Valilock = True
  1281.     Ydtext.Visible = False
  1282.     YdCombo.Visible = False
  1283.     YdCommand.Visible = False
  1284. End Sub
  1285. Private Sub YdCombo_KeyDown(KeyCode As Integer, Shift As Integer)        '列表框移动
  1286.     With WglrGrid
  1287.         Select Case KeyCode
  1288.         Case vbKeyEscape                'ESC 键放弃录入
  1289.             Valilock = True
  1290.             .SetFocus
  1291.             Call Ycwbk
  1292.             Valilock = False
  1293.         Case vbKeyReturn                '回 车 键 =13
  1294.             KeyCode = 0
  1295.             .SetFocus
  1296.             Call Lrsjhx
  1297.             Rowjsq = .Row
  1298.             Coljsq = .Col + 1
  1299.             If Coljsq > .Cols - 1 Then
  1300.                 If Rowjsq < .Rows - 1 Then
  1301.                     Rowjsq = Rowjsq + 1
  1302.                 End If
  1303.                 Coljsq = Qslz
  1304.             End If
  1305.             Do While Rowjsq <= .Rows - 1
  1306.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1307.                     Coljsq = Coljsq + 1
  1308.                     If Coljsq > .Cols - 1 Then
  1309.                         Rowjsq = Rowjsq + 1
  1310.                         Coljsq = Qslz
  1311.                     End If
  1312.                 Else
  1313.                     Exit Do
  1314.                 End If
  1315.             Loop
  1316.             .Select Rowjsq, Coljsq
  1317.         Case vbKeyLeft                  '左 箭 头 =37
  1318.             If .Col - 1 = Qslz Then
  1319.                 If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1320.                     GoTo jzzx
  1321.                 End If
  1322.             End If
  1323.             If .Col > Qslz Then
  1324.                 KeyCode = 0
  1325.                 .SetFocus
  1326.                 Call Lrsjhx
  1327.                 Coljsq = .Col - 1
  1328.                 Do While Coljsq > Qslz
  1329.                     If Coljsq - 1 = Qslz Then
  1330.                         If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1331.                             GoTo jzzx
  1332.                         End If
  1333.                     End If
  1334.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1335.                         Coljsq = Coljsq - 1
  1336.                     Else
  1337.                         Exit Do
  1338.                     End If
  1339.                 Loop
  1340.                 .Select .Row, Coljsq
  1341.             End If
  1342.             
  1343.         Case vbKeyRight                 '右 箭 头 =39
  1344.             KeyCode = 0
  1345.             .SetFocus
  1346.             Call Lrsjhx
  1347.             Rowjsq = .Row
  1348.             Coljsq = .Col + 1
  1349.             If Coljsq > .Cols - 1 Then
  1350.                 If Rowjsq < .Rows - 1 Then
  1351.                     Rowjsq = Rowjsq + 1
  1352.                 End If
  1353.                 Coljsq = Qslz
  1354.             End If
  1355.             Do While Rowjsq <= .Rows - 1
  1356.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1357.                     Coljsq = Coljsq + 1
  1358.                     If Coljsq > .Cols - 1 Then
  1359.                         Rowjsq = Rowjsq + 1
  1360.                         Coljsq = Qslz
  1361.                     End If
  1362.                 Else
  1363.                     Exit Do
  1364.                 End If
  1365.             Loop
  1366.             .Select Rowjsq, Coljsq
  1367.         Case Else
  1368.         End Select
  1369.         
  1370. jzzx:
  1371.         
  1372.     End With
  1373. End Sub
  1374. Private Sub YdCombo_LostFocus()
  1375.     With WglrGrid                                    '因为选中网格会先发生Rowcolchange事件置Valiock
  1376.         If Not Valilock Then                           '为TRUE
  1377.             Call Lrsjhx
  1378.             If Not Sjhzyxxpd(Dqlrwgh) Then
  1379.                 Exit Sub
  1380.             End If
  1381.         End If
  1382.     End With
  1383. End Sub
  1384. Private Sub Ydcommand_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
  1385.     Call Lrzdbz
  1386. End Sub
  1387. Private Sub ydtext_KeyDown(KeyCode As Integer, Shift As Integer)
  1388.     Dim Rowjsq As Long, Coljsq As Long
  1389.     With WglrGrid
  1390.         Select Case KeyCode
  1391.         Case vbKeyF2
  1392.             Call Lrzdbz
  1393.         Case vbKeyEscape                'ESC 键放弃录入
  1394.             Valilock = True
  1395.             Call Ycwbk
  1396.             .SetFocus
  1397.         Case vbKeyReturn                '回 车 键 =13
  1398.             KeyCode = 0
  1399.             .SetFocus
  1400.             Call Lrsjhx
  1401.             Rowjsq = .Row
  1402.             Coljsq = .Col + 1
  1403.             If Coljsq > .Cols - 1 Then
  1404.                 If Rowjsq < .Rows - 1 Then
  1405.                     Rowjsq = Rowjsq + 1
  1406.                 End If
  1407.                 Coljsq = Qslz
  1408.             End If
  1409.             Do While Rowjsq <= .Rows - 1
  1410.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1411.                     Coljsq = Coljsq + 1
  1412.                     If Coljsq > .Cols - 1 Then
  1413.                         Rowjsq = Rowjsq + 1
  1414.                         Coljsq = Qslz
  1415.                     End If
  1416.                 Else
  1417.                     Exit Do
  1418.                 End If
  1419.             Loop
  1420.             If Rowjsq <= .Rows - 1 Then
  1421.                 .Select Rowjsq, Coljsq
  1422.             End If
  1423.         Case vbKeyUp                    '上 箭 头 =38
  1424.             KeyCode = 0
  1425.             .SetFocus
  1426.             Call Lrsjhx
  1427.             If .Row > .FixedRows Then
  1428.                 .Row = .Row - 1
  1429.             End If
  1430.         Case vbKeyDown                  '下 箭 头 =40
  1431.             KeyCode = 0
  1432.             .SetFocus
  1433.             Call Lrsjhx
  1434.             If .Row < .Rows - 1 Then
  1435.                 .Row = .Row + 1
  1436.             End If
  1437.         Case vbKeyLeft                  '左 箭 头 =37
  1438.             If .Col - 1 = Qslz Then
  1439.                 If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1440.                     GoTo jzzx
  1441.                 End If
  1442.             End If
  1443.             If Ydtext.SelStart = 0 And .Col > Qslz Then
  1444.                 KeyCode = 0
  1445.                 .SetFocus
  1446.                 Call Lrsjhx
  1447.                 Coljsq = .Col - 1
  1448.                 Do While Coljsq > Qslz
  1449.                     If Coljsq - 1 = Qslz Then
  1450.                         If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1451.                             GoTo jzzx
  1452.                         End If
  1453.                     End If
  1454.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1455.                         Coljsq = Coljsq - 1
  1456.                     Else
  1457.                         Exit Do
  1458.                     End If
  1459.                 Loop
  1460.                 .Select .Row, Coljsq
  1461.             End If
  1462. jzzx:
  1463.             
  1464.             
  1465.         Case vbKeyRight                 '右 箭 头 =39
  1466.             wblong = Len(Ydtext.Text)
  1467.             If (Ydtext.SelStart = wblong Or Ydtext.SelLength = wblong) Then
  1468.                 KeyCode = 0
  1469.                 .SetFocus
  1470.                 Call Lrsjhx
  1471.                 Rowjsq = .Row
  1472.                 Coljsq = .Col + 1
  1473.                 If Coljsq > .Cols - 1 Then
  1474.                     If Rowjsq < .Rows - 1 Then
  1475.                         Rowjsq = Rowjsq + 1
  1476.                     End If
  1477.                     Coljsq = Qslz
  1478.                 End If
  1479.                 Do While Rowjsq <= .Rows - 1
  1480.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1481.                         Coljsq = Coljsq + 1
  1482.                         If Coljsq > .Cols - 1 Then
  1483.                             Rowjsq = Rowjsq + 1
  1484.                             Coljsq = Qslz
  1485.                         End If
  1486.                     Else
  1487.                         Exit Do
  1488.                     End If
  1489.                 Loop
  1490.                 .Select Rowjsq, Coljsq
  1491.             End If
  1492.         Case Else
  1493.         End Select
  1494.     End With
  1495. End Sub
  1496. Private Sub ydtext_KeyPress(KeyAscii As Integer)         '录入字符事中控制
  1497.     Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
  1498.     If KeyAscii <> 0 Then
  1499.         Call Xyxhbz(Dqlrwgh)
  1500.     End If
  1501. End Sub
  1502. Private Sub ydtext_Change()                              '录入事中变化处理
  1503.     
  1504.     '防止程序改变但不进行处理
  1505.     
  1506.     If Wbkbhlock Then
  1507.         Exit Sub
  1508.     End If
  1509.     
  1510.     With WglrGrid
  1511.         
  1512.         '限制字段录入长度
  1513.         Wbkbhlock = True
  1514.         Select Case GridInt(.Col, 1)
  1515.         Case 8
  1516.             Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
  1517.         Case 9
  1518.             Call Sjgskz(Ydtext, Xtslzws - Xtslxsws - 1, Xtslxsws)
  1519.         Case 10
  1520.             Call Sjgskz(Ydtext, Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1521.         Case Else
  1522.             If GridInt(.Col, 3) <> 0 Or GridInt(.Col, 4) <> 0 Then
  1523.                 Call Sjgskz(Ydtext, GridInt(.Col, 3), GridInt(.Col, 4))
  1524.             End If
  1525.         End Select
  1526.         Wbkbhlock = False
  1527.     End With
  1528. End Sub
  1529. Private Sub ydtext_LostFocus()            '如果由于选中网格之外的控件而发生有效性判断(选中网格会先发生Rowcolchange事件置Valiock为TRUE)
  1530.     With WglrGrid
  1531.         If Not Valilock Then
  1532.             Call Lrsjhx
  1533.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1534.                 Exit Sub
  1535.             End If
  1536.             If Not Sjhzyxxpd(Dqlrwgh) Then
  1537.                 Exit Sub
  1538.             End If
  1539.         End If
  1540.     End With
  1541. End Sub
  1542. Private Sub xswbk()                       '在当前选中单元显示文本框,列表框,帮助按钮(通用)
  1543.     Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
  1544.     
  1545.     '如果单据操作状态为浏览状态则不能显示录入载体
  1546.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1547.         Exit Sub
  1548.     End If
  1549.     
  1550.     '显示文本框前返回有效行列(解决滚动条问题)
  1551.     Call Xldqh
  1552.     Call Xldql
  1553.     
  1554.     '隐藏文本框,帮助按钮,列表组合框
  1555.     Call Ycwbk
  1556.     
  1557.     With WglrGrid
  1558.         Dqlrwgh = .Row
  1559.         Dqlrwgl = .Col
  1560.         If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
  1561.             Exit Sub
  1562.         End If
  1563.         
  1564.         Wbkpy = 30
  1565.         Wbkpy1 = 15
  1566.         
  1567.         If GridBoolean(.Col, 3) Then
  1568.             YdCombo.Left = .CellLeft + .Left + Wbkpy
  1569.             YdCombo.Top = .CellTop + .Top + Wbkpy
  1570.             YdCombo.Width = .CellWidth - Wbkpy1
  1571.             Call Wbkcl
  1572.             YdCombo.Visible = True
  1573.             YdCombo.SetFocus
  1574.             YdCommand.Visible = False
  1575.             Ydtext.Visible = False
  1576.         Else
  1577.             If GridBoolean(.Col, 2) Then
  1578.                 YdCommand.Left = .Left + .CellLeft + .CellWidth - YdCommand.Width + Wbkpy
  1579.                 YdCommand.Top = .Top + .CellTop + .CellHeight - YdCommand.Height + Wbkpy
  1580.                 YdCommand.Visible = True
  1581.             Else
  1582.                 YdCommand.Visible = False
  1583.             End If
  1584.             
  1585.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1586.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1587.             If YdCommand.Visible Then
  1588.                 If Sfblbzkd Then
  1589.                     Ydtext.Width = .CellWidth - YdCommand.Width
  1590.                 Else
  1591.                     Ydtext.Width = .CellWidth - Wbkpy1
  1592.                 End If
  1593.             Else
  1594.                 Ydtext.Width = .CellWidth - Wbkpy1
  1595.             End If
  1596.             Ydtext.Height = .CellHeight - Wbkpy1
  1597.             
  1598.             If GridInt(.Col, 2) <> 0 Then
  1599.                 Ydtext.MaxLength = GridInt(.Col, 2)
  1600.             Else
  1601.                 Ydtext.MaxLength = 3000
  1602.             End If
  1603.             
  1604.             Call Wbkcl
  1605.             
  1606.             Ydtext.Visible = True
  1607.             Ydtext.SetFocus
  1608.         End If
  1609.         Dqtoprow = .TopRow
  1610.         Dqleftcol = .LeftCol
  1611.         
  1612.         '重置锁值
  1613.         Valilock = False
  1614.         Wbkbhlock = False
  1615.     End With
  1616. End Sub
  1617. Private Sub Cxxswbk()                                                  'Formresize中重新显示文本框,列表框,帮助按钮(通用)
  1618.     
  1619.     Dim Wbkpy As Integer, Wbkpy1 As Integer
  1620.     Wbkpy = 30
  1621.     Wbkpy1 = 15
  1622.     With WglrGrid
  1623.         If YdCombo.Visible Then
  1624.             YdCombo.Left = .CellLeft + .Left + Wbkpy
  1625.             YdCombo.Top = .CellTop + .Top + Wbkpy
  1626.             YdCombo.Width = .CellWidth - Wbkpy1
  1627.         End If
  1628.         If YdCommand.Visible Then
  1629.             YdCommand.Left = .Left + .CellLeft + .CellWidth - YdCommand.Width + Wbkpy
  1630.             YdCommand.Top = .Top + .CellTop + .CellHeight - YdCommand.Height + Wbkpy
  1631.         End If
  1632.         If Ydtext.Visible Then
  1633.             If YdCommand.Visible Then
  1634.                 If Sfblbzkd Then
  1635.                     Ydtext.Width = .CellWidth - YdCommand.Width
  1636.                 Else
  1637.                     Ydtext.Width = .CellWidth - Wbkpy1
  1638.                 End If
  1639.             Else
  1640.                 Ydtext.Width = .CellWidth - Wbkpy1
  1641.             End If
  1642.             
  1643.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1644.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1645.             Ydtext.Height = .CellHeight - Wbkpy1
  1646.         End If
  1647.     End With
  1648.     
  1649. End Sub
  1650. Private Sub Lrsjhx()                                                   '文本框录入数据回写
  1651.     With WglrGrid
  1652.         If YdCombo.Visible Then
  1653.             .Text = Trim(YdCombo.Text)
  1654.         End If
  1655.         If Ydtext.Visible Then
  1656.             .Text = Trim(Ydtext.Text)
  1657.         End If
  1658.         
  1659.         '(如果字段录入内容发生变化,则打开有效性判断锁)
  1660.         If Zdlrqnr <> Trim(.Text) Then
  1661.             Yxxpdlock = False
  1662.             Hyxxpdlock = False
  1663.         End If
  1664.         
  1665.         '如果字段录入内容不为空则写数据行有效性标志
  1666.         
  1667.         If Len(Trim(.Text)) <> 0 Then
  1668.             Call Xyxhbz(.Row)
  1669.         End If
  1670.         
  1671.         '隐藏文本框,帮助按钮,列表组合框
  1672.         Call Ycwbk
  1673.         
  1674.     End With
  1675. End Sub
  1676. Private Sub WglrGrid_KeyDown(KeyCode As Integer, Shift As Integer)    '网格录入增行,删行快捷键
  1677.     
  1678.     '如果单据操作状态为浏览状态则不能显示录入载体
  1679.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1680.         Exit Sub
  1681.     End If
  1682.     
  1683.     Select Case KeyCode
  1684.     Case vbKeyDelete               '删行
  1685.         Call Scdqfl
  1686.     Case vbKeyInsert               '增行
  1687.         Call zjlrfl
  1688.     End Select
  1689. End Sub
  1690. Private Sub WglrGrid_KeyPress(KeyAscii As Integer)                     '网格接受键盘录入
  1691.     Dim Str_ChangeTe As String    '临时交换内容
  1692.     Dim Coljsq As Long            '临时列计数器
  1693.     Dim Int_SaveKey As Integer    '保存KeyAscii值
  1694.     
  1695.     '如果单据操作状态为浏览状态则不能显示录入载体
  1696.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1697.         Exit Sub
  1698.     End If
  1699.     
  1700.     Int_SaveKey = KeyAscii
  1701.     
  1702.     With WglrGrid
  1703.         '屏 蔽 回 车 键
  1704.         If KeyAscii = vbKeyReturn Then
  1705.             KeyAscii = 0
  1706.             Rowjsq = .Row
  1707.             Coljsq = .Col + 1
  1708.             If Coljsq > .Cols - 1 Then
  1709.                 If Rowjsq < .Rows - 1 Then
  1710.                     Rowjsq = Rowjsq + 1
  1711.                 End If
  1712.                 Coljsq = Qslz
  1713.             End If
  1714.             Do While Rowjsq <= .Rows - 1
  1715.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1716.                     Coljsq = Coljsq + 1
  1717.                     If Coljsq > .Cols - 1 Then
  1718.                         Rowjsq = Rowjsq + 1
  1719.                         Coljsq = Qslz
  1720.                     End If
  1721.                 Else
  1722.                     Exit Do
  1723.                 End If
  1724.             Loop
  1725.             If Rowjsq <= .Rows - 1 Then
  1726.                 .Select Rowjsq, Coljsq
  1727.             End If
  1728.             Exit Sub
  1729.         End If
  1730.         '接受用户录入
  1731.         Select Case KeyAscii
  1732.         Case 0 To 32
  1733.             
  1734.             '显示录入载体
  1735.             Call xswbk
  1736.             
  1737.         Case Else
  1738.             
  1739.             '防止非编辑字段SendKeys()出现死循环
  1740.             If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
  1741.                 Exit Sub
  1742.             End If
  1743.             
  1744.             If GridBoolean(.Col, 3) Then
  1745.                 
  1746.                 '列表框录入
  1747.                 Call xswbk
  1748.                 
  1749.             Else
  1750.                 
  1751.                 Ydtext.Text = ""
  1752.                 Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
  1753.                 If KeyAscii = 0 Then
  1754.                     Exit Sub
  1755.                 End If
  1756.                 
  1757.                 '写有效行数据标志
  1758.                 Call Xyxhbz(.Row)
  1759.                 Call xswbk
  1760.                 Ydtext.Text = ""
  1761.                 Valilock = True
  1762.                 SendKeys Chr(KeyAscii), wait
  1763.                 DoEvents
  1764.                 Valilock = False
  1765.                 
  1766.             End If
  1767.         End Select
  1768.     End With
  1769. End Sub
  1770. Private Sub zjlrfl()                                                    '增加录入分录
  1771.     With WglrGrid
  1772.         If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1773.             If Not Fun_Drfrmyxxpd Then
  1774.                 Exit Sub
  1775.             End If
  1776.         Else
  1777.             Exit Sub
  1778.         End If
  1779.         If .Row < .FixedRows Then
  1780.             Exit Sub
  1781.         End If
  1782.         .AddItem "", .Row
  1783.         .RowHeight(.Row) = Sjhgd
  1784.         
  1785.         
  1786.         If .Row <> .Rows - 1 Then
  1787.             If .TextMatrix(.Row + 1, 0) = "*" Then
  1788.                 .TextMatrix(.Row, 0) = "*"
  1789.             Else
  1790.                 .RemoveItem .Rows - 1
  1791.             End If
  1792.         End If
  1793.         Call Xldqh
  1794.         Call Xldql
  1795.         Hyxxpdlock = False
  1796.     End With
  1797. End Sub
  1798. Private Sub Scdqfl()                                                    '删除当前分录
  1799.     Dim Answer As Integer, Scqwghz As Long, Scqwglz As Long, Hjlzte As Long, Sflrzt As Boolean
  1800.     Dim RecTemp As New ADODB.Recordset             '临时使用动态集
  1801.     Dim SqlStr As String                           '临时连接字符串
  1802.     Dim Str_NowItemCode As String                  '辅助核算项目编码(现)
  1803.     
  1804.     With WglrGrid
  1805.         Scqwghz = .Row
  1806.         Scqwglz = .Col
  1807.         If .TextMatrix(.Row, 0) = "*" Then
  1808.             
  1809.             '判断是否为录入状态
  1810.             If Ydtext.Visible Or YdCombo.Visible Then
  1811.                 Sflrzt = True
  1812.                 Validate = True
  1813.                 Call Lrsjhx
  1814.                 Validate = False
  1815.             End If
  1816.             
  1817.             Call Xldqh
  1818.             changelock = True
  1819.             .Select .Row, 0
  1820.             changelock = False
  1821.             If Shsfts Then
  1822.                 .Cell(flexcpBackColor, .Row, Qslz, .Row, .Cols - 1) = QBColor(12)
  1823.                 Tsxx = "请确认是否删除当前记录?"
  1824.                 yhAnswer = Xtxxts(Tsxx, 2, 2)
  1825.                 If yhAnswer = 2 Then
  1826.                     .Cell(flexcpBackColor, .Row, Qslz, .Row, .Cols - 1) = &H80000005
  1827.                     changelock = True
  1828.                     .Select Scqwghz, Scqwglz
  1829.                     changelock = False
  1830.                     
  1831.                     '如为录入状态,则恢复录入
  1832.                     If Sflrzt Then
  1833.                         Call xswbk
  1834.                     End If
  1835.                     
  1836.                     Exit Sub
  1837.                 End If
  1838.             End If
  1839.             
  1840.             On Error GoTo Swcwcl
  1841.             
  1842.             Cw_DataEnvi.DataConnect.BeginTrans
  1843.             
  1844.             If Val(WglrGrid.TextMatrix(.Row, 1)) <> 0 Then
  1845.                 SqlStr = "SELECT i_id From cwfx_AccountBudgetMaster WHERE  I_id=" & Val(WglrGrid.TextMatrix(.Row, 1))
  1846.                 Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1847.                 If Not RecTemp.EOF Then
  1848.                     SqlStr = "Delete cwfx_AccountBudgetMaster Where I_id=" & Val(WglrGrid.TextMatrix(.Row, 1))
  1849.                     Cw_DataEnvi.DataConnect.Execute (SqlStr)
  1850.                 End If
  1851.             End If
  1852.             
  1853.             Cw_DataEnvi.DataConnect.CommitTrans
  1854.             
  1855.             .RemoveItem .Row
  1856.             
  1857.             If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1858.                 .AddItem ""
  1859.                 .RowHeight(.Rows - 1) = Sjhgd
  1860.             End If
  1861.             changelock = True
  1862.             .Select .Row, Scqwglz
  1863.             changelock = False
  1864.             
  1865.         End If
  1866.     End With
  1867.     
  1868.     Exit Sub
  1869.     
  1870.     '[>>事务错误处理
  1871. Swcwcl:
  1872.     Cw_DataEnvi.DataConnect.RollbackTrans
  1873.     txss = "删除过程中出现错误!"
  1874.     Call Xtxxts(Tsxx, 0, 1)
  1875.     Exit Sub
  1876.     '<<]
  1877. End Sub
  1878. Private Sub Qkwlzd(sjh As Long, Sjl As Long)                            '清空为零字段
  1879.     If Not GridBoolean(Sjl, 5) Then
  1880.         Exit Sub
  1881.     End If
  1882.     With WglrGrid
  1883.         If Val(Trim(.TextMatrix(sjh, Sjl))) = 0 Then
  1884.             .TextMatrix(sjh, Sjl) = ""
  1885.         End If
  1886.     End With
  1887. End Sub
  1888. Private Sub fhyxh()                                                     '返回录入数据有效行,同时让得到焦点网格可见
  1889.     With WglrGrid
  1890.         If .Row >= .FixedRows Then
  1891.             If .TextMatrix(.Row, 0) <> "*" Then
  1892.                 For Rowjsq = .FixedRows To .Rows - 1
  1893.                     If .TextMatrix(Rowjsq, 0) <> "*" Then
  1894.                         Exit For
  1895.                     End If
  1896.                 Next Rowjsq
  1897.                 If Rowjsq <= .Rows - 1 Then
  1898.                     changelock = True
  1899.                     .Select Rowjsq, .Col
  1900.                     changelock = False
  1901.                 Else
  1902.                     changelock = True
  1903.                     .Select .Rows - 1, .Col
  1904.                     changelock = False
  1905.                 End If
  1906.             End If
  1907.             Call Xldqh
  1908.         End If
  1909.     End With
  1910. End Sub
  1911. Private Sub Xldqh()                                                      '显露当前行
  1912.     Dim Toprowte As Long
  1913.     With WglrGrid
  1914.         Toprowte = 0
  1915.         Do While .CellTop + .RowHeight(.Row) + Fzxwghs * Sjhgd > .Height And .TopRow <> Toprowte
  1916.             Toprowte = .TopRow
  1917.             .TopRow = .TopRow + 1
  1918.         Loop
  1919.         Toprowte = 0
  1920.         Do While .CellTop < .FixedRows * .RowHeight(0) And .TopRow <> Toprowte
  1921.             Toprowte = .TopRow
  1922.             .TopRow = .TopRow - 1
  1923.         Loop
  1924.     End With
  1925. End Sub
  1926. Private Sub Xldql()                                                     '显露当前列
  1927.     Dim Leftcolte As Long
  1928.     With WglrGrid
  1929.         If .Col >= Qslz Then
  1930.             If .LeftCol > .Col Then
  1931.                 .LeftCol = .Col
  1932.             End If
  1933.             Leftcolte = 0
  1934.             Do While .CellLeft + .CellWidth > .Width And .LeftCol <> Leftcolte
  1935.                 Leftcolte = .LeftCol
  1936.                 .LeftCol = .LeftCol + 1
  1937.             Loop
  1938.         End If
  1939.     End With
  1940. End Sub
  1941. Private Function pdhwk(sjh As Long)                                     '判断网格行是否为空行(所有录入字段均为空*非录入字段除外)
  1942.     With WglrGrid
  1943.         For Coljsq = Qslz To .Cols - 1
  1944.             If Len(Trim(.TextMatrix(sjh, Coljsq))) <> 0 And GridBoolean(Coljsq, 1) Then
  1945.                 pdhwk = False
  1946.                 Exit Function
  1947.             End If
  1948.         Next Coljsq
  1949.         pdhwk = True
  1950.     End With
  1951. End Function
  1952. Private Sub Xyxhbz(sjh As Long)                                         '写行有效性标志,并判断是否增行
  1953.     With WglrGrid
  1954.         If .TextMatrix(sjh, 0) = "*" Then
  1955.             Exit Sub
  1956.         End If
  1957.         .TextMatrix(sjh, 0) = "*"
  1958.         If sjh >= .Rows - Fzxwghs - 1 Then
  1959.             .AddItem ""
  1960.             .RowHeight(.Rows - 1) = Sjhgd
  1961.         End If
  1962.     End With
  1963. End Sub
  1964. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1965.     Select Case Button.Key
  1966.     Case "bcgs"                              '保存表格格式
  1967.         Call Bcwggs(WglrGrid, GridCode, GridStr())
  1968.     Case "hfmrgs"                            '恢复默认格式
  1969.         Call Hfmrgs(WglrGrid, GridCode, GridStr())
  1970.     End Select
  1971. End Sub
  1972. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1973.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1974.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1975.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1976.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1977.     ReDim Bbxbt(1 To Bbxbtgs)
  1978.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1979.     If Bbbwhgs <> 0 Then
  1980.         ReDim Bbbwh(1 To Bbbwhgs)
  1981.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1982.     End If
  1983.     Bbzbt = ReportTitle
  1984.     Bbxbt(1) = Space(10) + Fun_FormatOutPut("会计年度:" + Str(Int_OriYear), 30)
  1985.     
  1986.     Call Scyxsjb(WglrGrid)                               '生成报表数据
  1987.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1988.     If Not bbylte Then
  1989.         Unload DY_Tybbyldy
  1990.     End If
  1991. End Sub
  1992. Private Sub ImportFromLastYear()
  1993.     SqlStr = "update cwfx_accountbudgetmaster set "
  1994.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_1=n.budget_1+n.add_1,"
  1995.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_2=n.budget_2+n.add_2,"
  1996.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_3=n.budget_3+n.add_3,"
  1997.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_4=n.budget_4+n.add_4,"
  1998.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_5=n.budget_5+n.add_5,"
  1999.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_6=n.budget_6+n.add_6,"
  2000.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_7=n.budget_7+n.add_7,"
  2001.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_8=n.budget_8+n.add_8,"
  2002.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_9=n.budget_9+n.add_9,"
  2003.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_10=n.budget_10+n.add_10,"
  2004.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_11=n.budget_11+n.add_11,"
  2005.     SqlStr = SqlStr + "cwfx_accountbudgetmaster.budget_12 = n.budget_12 + n.add_12"
  2006.     
  2007.     SqlStr = SqlStr + " from cwfx_accountbudgetmaster,cwfx_accountbudgetmaster as n "
  2008.     SqlStr = SqlStr + " Where cwfx_accountbudgetmaster.ccode = n.ccode And "
  2009.     SqlStr = SqlStr + " cwfx_accountbudgetmaster.Year =" & Int_OriYear & " And n.Year =" & Int_OriYear - 1
  2010.     Cw_DataEnvi.DataConnect.Execute (SqlStr)
  2011.     Tsxx = "导入完毕"
  2012.     Call Xtxxts(Tsxx, 0, 4)
  2013. End Sub