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

企业管理

开发平台:

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