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

企业管理

开发平台:

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. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form JC_KjkmszFrm 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "会计科目设置"
  8.    ClientHeight    =   7095
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   9375
  12.    HelpContextID   =   2001
  13.    Icon            =   "基础设置_会计科目设置.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   7095
  19.    ScaleWidth      =   9375
  20.    StartUpPosition =   2  '屏幕中心
  21.    Begin TabDlg.SSTab StTab 
  22.       Height          =   6375
  23.       Left            =   30
  24.       TabIndex        =   0
  25.       Top             =   690
  26.       Width           =   9330
  27.       _ExtentX        =   16457
  28.       _ExtentY        =   11245
  29.       _Version        =   393216
  30.       Style           =   1
  31.       Tabs            =   2
  32.       TabHeight       =   520
  33.       TabCaption(0)   =   "列表视图"
  34.       TabPicture(0)   =   "基础设置_会计科目设置.frx":1042
  35.       Tab(0).ControlEnabled=   -1  'True
  36.       Tab(0).Control(0)=   "CzxsGrid"
  37.       Tab(0).Control(0).Enabled=   0   'False
  38.       Tab(0).ControlCount=   1
  39.       TabCaption(1)   =   "单张视图"
  40.       TabPicture(1)   =   "基础设置_会计科目设置.frx":105E
  41.       Tab(1).ControlEnabled=   0   'False
  42.       Tab(1).Control(0)=   "Frame1"
  43.       Tab(1).ControlCount=   1
  44.       Begin VB.Frame Frame1 
  45.          Height          =   5955
  46.          Left            =   -74910
  47.          TabIndex        =   26
  48.          Top             =   330
  49.          Width           =   9135
  50.          Begin VB.Frame Frame5 
  51.             Caption         =   "打印"
  52.             ForeColor       =   &H00FF0000&
  53.             Height          =   990
  54.             Left            =   270
  55.             TabIndex        =   44
  56.             Top             =   4860
  57.             Width           =   3600
  58.             Begin VB.TextBox LrText 
  59.                Height          =   300
  60.                Index           =   6
  61.                Left            =   1020
  62.                TabIndex        =   48
  63.                Text            =   "6"
  64.                Top             =   570
  65.                Width           =   2430
  66.             End
  67.             Begin VB.CheckBox Chk_SumPrint 
  68.                Caption         =   "汇总打印"
  69.                Height          =   240
  70.                Left            =   180
  71.                TabIndex        =   11
  72.                Top             =   255
  73.                Width           =   1185
  74.             End
  75.             Begin VB.Label Label1 
  76.                AutoSize        =   -1  'True
  77.                Caption         =   "汇总科目:"
  78.                Height          =   180
  79.                Left            =   195
  80.                TabIndex        =   45
  81.                Top             =   630
  82.                Width           =   810
  83.             End
  84.          End
  85.          Begin VB.CheckBox Chk_DayBookFlag 
  86.             Caption         =   "日记帐"
  87.             Height          =   225
  88.             Left            =   4410
  89.             TabIndex        =   21
  90.             Top             =   4050
  91.             Width           =   1065
  92.          End
  93.          Begin VB.TextBox LrText 
  94.             Height          =   300
  95.             Index           =   5
  96.             Left            =   1110
  97.             TabIndex        =   6
  98.             Text            =   "5"
  99.             Top             =   2340
  100.             Width           =   1725
  101.          End
  102.          Begin VB.CheckBox Chk_CashFlow 
  103.             Caption         =   "现金或现金等价物"
  104.             Height          =   315
  105.             Left            =   4410
  106.             TabIndex        =   22
  107.             Top             =   4320
  108.             Width           =   1785
  109.          End
  110.          Begin VB.Frame Frame4 
  111.             Caption         =   "项目核算(I)"
  112.             ForeColor       =   &H00FF0000&
  113.             Height          =   945
  114.             Left            =   4380
  115.             TabIndex        =   40
  116.             Top             =   2940
  117.             Width           =   2955
  118.             Begin VB.CommandButton Ydcommand1 
  119.                Height          =   300
  120.                Index           =   4
  121.                Left            =   2550
  122.                Picture         =   "基础设置_会计科目设置.frx":107A
  123.                Style           =   1  'Graphical
  124.                TabIndex        =   42
  125.                Top             =   540
  126.                Visible         =   0   'False
  127.                Width           =   300
  128.             End
  129.             Begin VB.TextBox LrText 
  130.                Height          =   300
  131.                Index           =   4
  132.                Left            =   870
  133.                TabIndex        =   20
  134.                Text            =   "4"
  135.                Top             =   540
  136.                Width           =   1680
  137.             End
  138.             Begin VB.CheckBox Chk_Ass 
  139.                Caption         =   "项目核算"
  140.                Height          =   255
  141.                Index           =   3
  142.                Left            =   90
  143.                TabIndex        =   19
  144.                Top             =   270
  145.                Width           =   1335
  146.             End
  147.             Begin VB.Label TsLabel 
  148.                AutoSize        =   -1  'True
  149.                Caption         =   "项目类别:"
  150.                Height          =   180
  151.                Index           =   4
  152.                Left            =   60
  153.                TabIndex        =   41
  154.                Top             =   600
  155.                Width           =   810
  156.             End
  157.          End
  158.          Begin VB.CommandButton BcCommand 
  159.             Caption         =   "保存(&S)"
  160.             Height          =   300
  161.             Left            =   4530
  162.             TabIndex        =   23
  163.             Top             =   4950
  164.             Width           =   1120
  165.          End
  166.          Begin VB.CommandButton QxCommand 
  167.             Cancel          =   -1  'True
  168.             Caption         =   "取消(&C)"
  169.             Height          =   300
  170.             Left            =   5730
  171.             TabIndex        =   24
  172.             Top             =   4950
  173.             Width           =   1120
  174.          End
  175.          Begin VB.CheckBox ChkStopUse 
  176.             Caption         =   "停用"
  177.             Height          =   315
  178.             Left            =   4380
  179.             TabIndex        =   12
  180.             Top             =   180
  181.             Width           =   705
  182.          End
  183.          Begin VB.ComboBox Combo_AccFormat 
  184.             Height          =   300
  185.             Left            =   1125
  186.             Style           =   2  'Dropdown List
  187.             TabIndex        =   5
  188.             Top             =   1920
  189.             Width           =   1725
  190.          End
  191.          Begin VB.Frame Frame3 
  192.             Caption         =   "外币核算(&F)"
  193.             ForeColor       =   &H00FF0000&
  194.             Height          =   975
  195.             Left            =   270
  196.             TabIndex        =   36
  197.             Top             =   2730
  198.             Width           =   3615
  199.             Begin VB.CommandButton Ydcommand1 
  200.                Height          =   300
  201.                Index           =   2
  202.                Left            =   3150
  203.                Picture         =   "基础设置_会计科目设置.frx":1404
  204.                Style           =   1  'Graphical
  205.                TabIndex        =   39
  206.                Top             =   540
  207.                Visible         =   0   'False
  208.                Width           =   300
  209.             End
  210.             Begin VB.TextBox LrText 
  211.                Height          =   300
  212.                Index           =   2
  213.                Left            =   990
  214.                TabIndex        =   8
  215.                Text            =   "2"
  216.                Top             =   540
  217.                Width           =   2160
  218.             End
  219.             Begin VB.CheckBox Chk_ForiFlag 
  220.                Caption         =   "外币核算"
  221.                Height          =   225
  222.                Left            =   180
  223.                TabIndex        =   7
  224.                Top             =   270
  225.                Width           =   2055
  226.             End
  227.             Begin VB.Label TsLabel 
  228.                AutoSize        =   -1  'True
  229.                Caption         =   "核算币种:"
  230.                Height          =   180
  231.                Index           =   6
  232.                Left            =   180
  233.                TabIndex        =   37
  234.                Top             =   600
  235.                Width           =   810
  236.             End
  237.          End
  238.          Begin VB.Frame Frame2 
  239.             Caption         =   "数量核算(&Q)"
  240.             ForeColor       =   &H00FF0000&
  241.             Height          =   1035
  242.             Index           =   2
  243.             Left            =   270
  244.             TabIndex        =   34
  245.             Top             =   3780
  246.             Width           =   3615
  247.             Begin VB.TextBox LrText 
  248.                Height          =   300
  249.                Index           =   3
  250.                Left            =   990
  251.                TabIndex        =   10
  252.                Text            =   "3"
  253.                Top             =   570
  254.                Width           =   2460
  255.             End
  256.             Begin VB.CheckBox Chk_QuatFlag 
  257.                Caption         =   "数量核算"
  258.                Height          =   255
  259.                Left            =   180
  260.                TabIndex        =   9
  261.                Top             =   270
  262.                Width           =   2385
  263.             End
  264.             Begin VB.Label TsLabel 
  265.                AutoSize        =   -1  'True
  266.                Caption         =   "计量单位:"
  267.                Height          =   180
  268.                Index           =   5
  269.                Left            =   180
  270.                TabIndex        =   35
  271.                Top             =   630
  272.                Width           =   810
  273.             End
  274.          End
  275.          Begin VB.Frame Frame2 
  276.             Caption         =   "辅助核算(&A)"
  277.             ForeColor       =   &H00FF0000&
  278.             Height          =   1395
  279.             Index           =   1
  280.             Left            =   4380
  281.             TabIndex        =   33
  282.             Top             =   1470
  283.             Width           =   1695
  284.             Begin VB.CheckBox Chk_Ass 
  285.                Caption         =   "供应商往来"
  286.                Height          =   255
  287.                Index           =   4
  288.                Left            =   180
  289.                TabIndex        =   16
  290.                Top             =   510
  291.                Width           =   1335
  292.             End
  293.             Begin VB.CheckBox Chk_Ass 
  294.                Caption         =   "个人往来"
  295.                Height          =   255
  296.                Index           =   2
  297.                Left            =   180
  298.                TabIndex        =   18
  299.                Top             =   1050
  300.                Width           =   1335
  301.             End
  302.             Begin VB.CheckBox Chk_Ass 
  303.                Caption         =   "部门"
  304.                Height          =   255
  305.                Index           =   1
  306.                Left            =   180
  307.                TabIndex        =   17
  308.                Top             =   795
  309.                Width           =   1335
  310.             End
  311.             Begin VB.CheckBox Chk_Ass 
  312.                Caption         =   "客户往来"
  313.                Height          =   255
  314.                Index           =   0
  315.                Left            =   180
  316.                TabIndex        =   15
  317.                Top             =   240
  318.                Width           =   1335
  319.             End
  320.          End
  321.          Begin VB.Frame Frame2 
  322.             Caption         =   "余额方向(&O)"
  323.             ForeColor       =   &H00FF0000&
  324.             Height          =   825
  325.             Index           =   0
  326.             Left            =   4380
  327.             TabIndex        =   32
  328.             Top             =   540
  329.             Width           =   1695
  330.             Begin VB.OptionButton Opt_Yefx 
  331.                Caption         =   "贷方"
  332.                Height          =   225
  333.                Index           =   1
  334.                Left            =   150
  335.                TabIndex        =   14
  336.                Top             =   510
  337.                Width           =   1215
  338.             End
  339.             Begin VB.OptionButton Opt_Yefx 
  340.                Caption         =   "借方"
  341.                Height          =   225
  342.                Index           =   0
  343.                Left            =   150
  344.                TabIndex        =   13
  345.                Top             =   240
  346.                Width           =   1215
  347.             End
  348.          End
  349.          Begin VB.ComboBox Combo_Prop 
  350.             Height          =   300
  351.             Left            =   1125
  352.             Style           =   2  'Dropdown List
  353.             TabIndex        =   4
  354.             Top             =   1485
  355.             Width           =   1725
  356.          End
  357.          Begin VB.ComboBox Combo_Class 
  358.             Height          =   300
  359.             Left            =   1125
  360.             Style           =   2  'Dropdown List
  361.             TabIndex        =   3
  362.             Top             =   1065
  363.             Width           =   1725
  364.          End
  365.          Begin VB.CommandButton Ydcommand1 
  366.             Height          =   300
  367.             Index           =   0
  368.             Left            =   8370
  369.             Picture         =   "基础设置_会计科目设置.frx":178E
  370.             Style           =   1  'Graphical
  371.             TabIndex        =   27
  372.             Top             =   1320
  373.             Visible         =   0   'False
  374.             Width           =   300
  375.          End
  376.          Begin VB.TextBox LrText 
  377.             Height          =   300
  378.             Index           =   1
  379.             Left            =   1125
  380.             TabIndex        =   2
  381.             Text            =   "1"
  382.             Top             =   660
  383.             Width           =   2775
  384.          End
  385.          Begin VB.TextBox LrText 
  386.             Height          =   300
  387.             Index           =   0
  388.             Left            =   1140
  389.             TabIndex        =   1
  390.             Text            =   "0"
  391.             Top             =   240
  392.             Width           =   1710
  393.          End
  394.          Begin VB.Label TsLabel 
  395.             AutoSize        =   -1  'True
  396.             Caption         =   "助记码:"
  397.             Height          =   180
  398.             Index           =   8
  399.             Left            =   270
  400.             TabIndex        =   43
  401.             Top             =   2400
  402.             Width           =   630
  403.          End
  404.          Begin VB.Label TsLabel 
  405.             AutoSize        =   -1  'True
  406.             Caption         =   "帐页格式:"
  407.             Height          =   180
  408.             Index           =   7
  409.             Left            =   285
  410.             TabIndex        =   38
  411.             Top             =   1980
  412.             Width           =   810
  413.          End
  414.          Begin VB.Label TsLabel 
  415.             AutoSize        =   -1  'True
  416.             Caption         =   "科目性质:"
  417.             Height          =   180
  418.             Index           =   2
  419.             Left            =   285
  420.             TabIndex        =   31
  421.             Top             =   1545
  422.             Width           =   810
  423.          End
  424.          Begin VB.Label TsLabel 
  425.             AutoSize        =   -1  'True
  426.             Caption         =   "科目类型:"
  427.             Height          =   180
  428.             Index           =   3
  429.             Left            =   285
  430.             TabIndex        =   30
  431.             Top             =   1125
  432.             Width           =   810
  433.          End
  434.          Begin VB.Label TsLabel 
  435.             AutoSize        =   -1  'True
  436.             Caption         =   "科目名称:"
  437.             Height          =   180
  438.             Index           =   1
  439.             Left            =   285
  440.             TabIndex        =   29
  441.             Top             =   720
  442.             Width           =   810
  443.          End
  444.          Begin VB.Label TsLabel 
  445.             AutoSize        =   -1  'True
  446.             Caption         =   "科目编码:"
  447.             Height          =   180
  448.             Index           =   0
  449.             Left            =   285
  450.             TabIndex        =   28
  451.             Top             =   300
  452.             Width           =   810
  453.          End
  454.       End
  455.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  456.          Height          =   5895
  457.          Left            =   90
  458.          TabIndex        =   25
  459.          Top             =   390
  460.          Width           =   9135
  461.          _cx             =   5080
  462.          _cy             =   5080
  463.          Appearance      =   1
  464.          BorderStyle     =   1
  465.          Enabled         =   -1  'True
  466.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  467.             Name            =   "宋体"
  468.             Size            =   9
  469.             Charset         =   134
  470.             Weight          =   400
  471.             Underline       =   0   'False
  472.             Italic          =   0   'False
  473.             Strikethrough   =   0   'False
  474.          EndProperty
  475.          MousePointer    =   0
  476.          BackColor       =   -2147483643
  477.          ForeColor       =   -2147483640
  478.          BackColorFixed  =   -2147483633
  479.          ForeColorFixed  =   -2147483630
  480.          BackColorSel    =   -2147483635
  481.          ForeColorSel    =   -2147483634
  482.          BackColorBkg    =   8421504
  483.          BackColorAlternate=   -2147483643
  484.          GridColor       =   -2147483633
  485.          GridColorFixed  =   -2147483632
  486.          TreeColor       =   -2147483632
  487.          FloodColor      =   192
  488.          SheetBorder     =   -2147483642
  489.          FocusRect       =   1
  490.          HighLight       =   1
  491.          AllowSelection  =   -1  'True
  492.          AllowBigSelection=   -1  'True
  493.          AllowUserResizing=   0
  494.          SelectionMode   =   0
  495.          GridLines       =   1
  496.          GridLinesFixed  =   2
  497.          GridLineWidth   =   1
  498.          Rows            =   5000
  499.          Cols            =   10
  500.          FixedRows       =   1
  501.          FixedCols       =   0
  502.          RowHeightMin    =   0
  503.          RowHeightMax    =   0
  504.          ColWidthMin     =   0
  505.          ColWidthMax     =   0
  506.          ExtendLastCol   =   0   'False
  507.          FormatString    =   ""
  508.          ScrollTrack     =   0   'False
  509.          ScrollBars      =   3
  510.          ScrollTips      =   0   'False
  511.          MergeCells      =   0
  512.          MergeCompare    =   0
  513.          AutoResize      =   -1  'True
  514.          AutoSizeMode    =   0
  515.          AutoSearch      =   0
  516.          AutoSearchDelay =   2
  517.          MultiTotals     =   -1  'True
  518.          SubtotalPosition=   1
  519.          OutlineBar      =   0
  520.          OutlineCol      =   0
  521.          Ellipsis        =   0
  522.          ExplorerBar     =   0
  523.          PicturesOver    =   0   'False
  524.          FillStyle       =   0
  525.          RightToLeft     =   0   'False
  526.          PictureType     =   0
  527.          TabBehavior     =   0
  528.          OwnerDraw       =   0
  529.          Editable        =   0
  530.          ShowComboButton =   1
  531.          WordWrap        =   0   'False
  532.          TextStyle       =   0
  533.          TextStyleFixed  =   0
  534.          OleDragMode     =   0
  535.          OleDropMode     =   0
  536.          DataMode        =   0
  537.          VirtualData     =   -1  'True
  538.          DataMember      =   ""
  539.          ComboSearch     =   3
  540.          AutoSizeMouse   =   -1  'True
  541.          FrozenRows      =   0
  542.          FrozenCols      =   0
  543.          AllowUserFreezing=   0
  544.          BackColorFrozen =   0
  545.          ForeColorFrozen =   0
  546.          WallPaperAlignment=   9
  547.          AccessibleName  =   ""
  548.          AccessibleDescription=   ""
  549.          AccessibleValue =   ""
  550.          AccessibleRole  =   24
  551.       End
  552.    End
  553.    Begin MSComctlLib.ImageList ImageList1 
  554.       Left            =   0
  555.       Top             =   420
  556.       _ExtentX        =   1005
  557.       _ExtentY        =   1005
  558.       BackColor       =   -2147483643
  559.       ImageWidth      =   16
  560.       ImageHeight     =   16
  561.       MaskColor       =   12632256
  562.       _Version        =   393216
  563.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  564.          NumListImages   =   29
  565.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  566.             Picture         =   "基础设置_会计科目设置.frx":1B18
  567.             Key             =   "sz"
  568.          EndProperty
  569.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  570.             Picture         =   "基础设置_会计科目设置.frx":1EB2
  571.             Key             =   "dy"
  572.          EndProperty
  573.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  574.             Picture         =   "基础设置_会计科目设置.frx":224C
  575.             Key             =   "yl"
  576.          EndProperty
  577.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  578.             Picture         =   "基础设置_会计科目设置.frx":25E6
  579.             Key             =   "xg"
  580.          EndProperty
  581.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  582.             Picture         =   "基础设置_会计科目设置.frx":2980
  583.             Key             =   "zh"
  584.          EndProperty
  585.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  586.             Picture         =   "基础设置_会计科目设置.frx":2D1A
  587.             Key             =   "sh"
  588.          EndProperty
  589.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  590.             Picture         =   "基础设置_会计科目设置.frx":30B4
  591.             Key             =   "bc"
  592.          EndProperty
  593.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  594.             Picture         =   "基础设置_会计科目设置.frx":344E
  595.             Key             =   "fq"
  596.          EndProperty
  597.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  598.             Picture         =   "基础设置_会计科目设置.frx":37E8
  599.             Key             =   "bz"
  600.          EndProperty
  601.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  602.             Picture         =   "基础设置_会计科目设置.frx":3B82
  603.             Key             =   "tc"
  604.          EndProperty
  605.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  606.             Picture         =   "基础设置_会计科目设置.frx":3F1C
  607.             Key             =   "bcgs"
  608.          EndProperty
  609.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  610.             Picture         =   "基础设置_会计科目设置.frx":42B6
  611.             Key             =   "mrlk"
  612.          EndProperty
  613.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  614.             Picture         =   "基础设置_会计科目设置.frx":4650
  615.             Key             =   "xsxm"
  616.          EndProperty
  617.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  618.             Picture         =   "基础设置_会计科目设置.frx":49EA
  619.             Key             =   "first"
  620.          EndProperty
  621.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  622.             Picture         =   "基础设置_会计科目设置.frx":4D84
  623.             Key             =   "prev"
  624.          EndProperty
  625.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  626.             Picture         =   "基础设置_会计科目设置.frx":511E
  627.             Key             =   "next"
  628.          EndProperty
  629.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  630.             Picture         =   "基础设置_会计科目设置.frx":54B8
  631.             Key             =   "last"
  632.          EndProperty
  633.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  634.             Picture         =   "基础设置_会计科目设置.frx":5852
  635.             Key             =   "xx"
  636.          EndProperty
  637.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  638.             Picture         =   "基础设置_会计科目设置.frx":5BEC
  639.             Key             =   "define"
  640.          EndProperty
  641.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  642.             Picture         =   "基础设置_会计科目设置.frx":5F86
  643.             Key             =   "exec"
  644.          EndProperty
  645.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  646.             Picture         =   "基础设置_会计科目设置.frx":6320
  647.             Key             =   "xz"
  648.          EndProperty
  649.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  650.             Picture         =   "基础设置_会计科目设置.frx":66BA
  651.             Key             =   "sc"
  652.          EndProperty
  653.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  654.             Picture         =   "基础设置_会计科目设置.frx":6A54
  655.             Key             =   "sx"
  656.          EndProperty
  657.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  658.             Picture         =   "基础设置_会计科目设置.frx":6DEE
  659.             Key             =   "cx"
  660.          EndProperty
  661.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  662.             Picture         =   "基础设置_会计科目设置.frx":7188
  663.             Key             =   "zd"
  664.          EndProperty
  665.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  666.             Picture         =   "基础设置_会计科目设置.frx":7522
  667.             Key             =   "dz"
  668.          EndProperty
  669.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  670.             Picture         =   "基础设置_会计科目设置.frx":78BC
  671.             Key             =   "ph"
  672.          EndProperty
  673.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  674.             Picture         =   "基础设置_会计科目设置.frx":7C56
  675.             Key             =   "fz"
  676.          EndProperty
  677.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  678.             Picture         =   "基础设置_会计科目设置.frx":7FF0
  679.             Key             =   "dw"
  680.          EndProperty
  681.       EndProperty
  682.    End
  683.    Begin MSComctlLib.Toolbar SzToolbar 
  684.       Align           =   1  'Align Top
  685.       Height          =   555
  686.       Left            =   0
  687.       TabIndex        =   46
  688.       Top             =   0
  689.       Width           =   9375
  690.       _ExtentX        =   16536
  691.       _ExtentY        =   979
  692.       ButtonWidth     =   820
  693.       ButtonHeight    =   926
  694.       AllowCustomize  =   0   'False
  695.       Appearance      =   1
  696.       Style           =   1
  697.       ImageList       =   "ImageList1"
  698.       _Version        =   393216
  699.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  700.          NumButtons      =   13
  701.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  702.             Caption         =   "设置"
  703.             Key             =   "ymsz"
  704.             ImageKey        =   "sz"
  705.          EndProperty
  706.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  707.             Caption         =   "打印"
  708.             Key             =   "dy"
  709.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  710.             ImageKey        =   "dy"
  711.          EndProperty
  712.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  713.             Caption         =   "预览"
  714.             Key             =   "yl"
  715.             ImageKey        =   "yl"
  716.          EndProperty
  717.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  718.             Style           =   3
  719.          EndProperty
  720.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  721.             Caption         =   "增加"
  722.             Key             =   "zj"
  723.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  724.             ImageKey        =   "xz"
  725.          EndProperty
  726.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  727.             Caption         =   "修改"
  728.             Key             =   "xg"
  729.             ImageKey        =   "xg"
  730.          EndProperty
  731.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  732.             Caption         =   "删除"
  733.             Key             =   "sc"
  734.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  735.             ImageKey        =   "sc"
  736.          EndProperty
  737.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  738.             Style           =   3
  739.          EndProperty
  740.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  741.             Caption         =   "定位"
  742.             Key             =   "dw"
  743.             ImageKey        =   "dw"
  744.          EndProperty
  745.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  746.             Caption         =   "刷新"
  747.             Key             =   "sx"
  748.             ImageKey        =   "sx"
  749.          EndProperty
  750.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  751.             Style           =   3
  752.          EndProperty
  753.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  754.             Caption         =   "帮助"
  755.             Key             =   "bz"
  756.             ImageKey        =   "bz"
  757.          EndProperty
  758.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  759.             Caption         =   "退出"
  760.             Key             =   "fh"
  761.             ImageKey        =   "tc"
  762.          EndProperty
  763.       EndProperty
  764.       BorderStyle     =   1
  765.       Begin MSComctlLib.Toolbar GsToolbar 
  766.          Height          =   525
  767.          Left            =   6870
  768.          TabIndex        =   47
  769.          Top             =   0
  770.          Width           =   2475
  771.          _ExtentX        =   4366
  772.          _ExtentY        =   926
  773.          ButtonWidth     =   1455
  774.          ButtonHeight    =   926
  775.          AllowCustomize  =   0   'False
  776.          Appearance      =   1
  777.          Style           =   1
  778.          ImageList       =   "ImageList1"
  779.          _Version        =   393216
  780.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  781.             NumButtons      =   3
  782.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  783.                Caption         =   "保存格式"
  784.                Key             =   "bcgs"
  785.                ImageKey        =   "bcgs"
  786.             EndProperty
  787.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  788.                Caption         =   "默认列宽"
  789.                Key             =   "hfmrgs"
  790.                ImageKey        =   "mrlk"
  791.             EndProperty
  792.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  793.                Caption         =   "显示项目"
  794.                Key             =   "szxsxm"
  795.                ImageKey        =   "xsxm"
  796.             EndProperty
  797.          EndProperty
  798.       End
  799.    End
  800. End
  801. Attribute VB_Name = "JC_KjkmszFrm"
  802. Attribute VB_GlobalNameSpace = False
  803. Attribute VB_Creatable = False
  804. Attribute VB_PredeclaredId = True
  805. Attribute VB_Exposed = False
  806. '*******************************************************
  807. '*    模 块 名 称 :会计科目设置
  808. '*    功 能 描 述 :设置公司会计科目
  809. '*    程序员姓名  :张建忠
  810. '*    最后修改人  :张建忠
  811. '*    最后修改时间:2001/11/17
  812. '*    备        注:
  813. '*******************************************************
  814. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  815. Dim RecCodeScheme As New ADODB.Recordset '系统编码方案表
  816. Dim RecTemp As Recordset                 '临时使用动态集
  817. Dim Int_CodeScheme() As Integer          '会计科目编码方案
  818. Dim Int_CodeLev As Integer               '会计科目编码级次
  819. Dim jdzygs As Integer                    '控件焦点转移个数
  820. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  821. Dim ReportTitle As String                '报表主标题
  822. Dim Bln_ChkAssLock As Boolean            '辅助核算控制锁
  823. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  824. '以下为固定使用变量(网格)
  825. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  826. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  827. Dim GridCode As String                   '显示网格网格代码
  828. Dim GridInf() As Variant                 '整个网格设置信息
  829. Dim Tsxx As String                       '系统提示信息
  830. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  831. Dim Sjhgd As Double                      '网格数据行高度
  832. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  833. Dim GridStr()  As String                 '网格列信息(字符型)
  834. Dim GridInt() As Integer                 '网格列信息(整型)
  835. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  836. '以下为固定使用变量(文本框)
  837. Dim Textvar() As Variant                 '存储变体型文本框信息
  838. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  839. Dim Textint() As Integer                 '存储整型文本框信息
  840. Dim Textstr() As String                  '存储字符型文本框信息
  841. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  842. Dim TextGroupCode As String              '文本框录入分组编码
  843. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  844. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  845. Dim CurTextIndex As Integer              '当前文本框索引值
  846. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  847. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  848. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  849.     
  850.     jdzygs = 25
  851.     
  852.     Select Case KeyAscii
  853.     Case vbKeyReturn
  854.         If Kjjdzy(jdzygs) Then
  855.             KeyAscii = 0
  856.         End If
  857.     Case 39           '屏蔽"'"
  858.         KeyAscii = 0
  859.     End Select
  860.     
  861. End Sub
  862. Private Sub Form_Load()
  863.     
  864.     '打印报表标题信息
  865.     ReportTitle = "会 计 科 目 表"
  866.     
  867.     '调入打印页面设置窗体
  868.     XtReportCode = "Cwzz_Kjkmsz"
  869.     Load Dyymctbl
  870.     
  871.     '以下为文本框处理程序(读入文本框录入信息)
  872.     TextGroupCode = "Cwzz_Kjkmsz"
  873.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  874.     Call Wbkcsh
  875.     
  876.     '调入网格设置信息
  877.     GridCode = "Cwzz_Kjkmsz"
  878.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  879.     Qslz = GridInf(1)
  880.     Sjhgd = GridInf(2)
  881.     Szzls = CzxsGrid.Cols - 1
  882.     
  883.     '填 充 网 格
  884.     Call Cxnrtcwg
  885.     
  886.     '初始化ToolBar,Tab卡状态
  887.     StTab.Tab = 0
  888.     StTab.TabEnabled(1) = False
  889.     Frame1.Enabled = False
  890.     
  891.     '设置为非录入状态
  892.     Lrzt = 0
  893.     
  894.     '初始化科目类型列表框
  895.     Call FillCombo(Combo_Class, "Cwzz_Kmlx", "", 0)
  896.     
  897.     '初始化科目性质列表框
  898.     Call FillCombo(Combo_Prop, "Cwzz_Kmxz", "", 0)
  899.     
  900.     '初始化帐页格式列表框
  901.     Call FillCombo(Combo_AccFormat, "Cwzz_Zygs", "", 0)
  902.     
  903.     '读入会计科目编码方案
  904.     Set RecCodeScheme = Cw_DataEnvi.DataConnect.Execute("Select CodeScheme From Gy_CodeScheme Where ItemCode='Cwzz_Kmcode'")
  905.     With RecCodeScheme
  906.         If Not .EOF Then
  907.             Int_CodeLev = Len(Trim(.Fields("CodeScheme")))
  908.             ReDim Int_CodeScheme(Int_CodeLev)
  909.             lenjsq = 0
  910.             For Jsqte = 1 To Int_CodeLev
  911.                 lenjsq = lenjsq + Mid(Trim(.Fields("CodeScheme")), Jsqte, 1)
  912.                 Int_CodeScheme(Jsqte) = lenjsq
  913.             Next Jsqte
  914.         End If
  915.         .Close
  916.     End With
  917.     
  918.     '初始化余额方向
  919.     Opt_Yefx(0).Value = True
  920.     
  921.     '初始化外币 数量 项目核算标志 汇总打印
  922.     Call Textwx(LrText(2))
  923.     Call Textwx(LrText(3))
  924.     Ydcommand1(2).Enabled = False
  925.     Call Textwx(LrText(4))
  926.     Ydcommand1(4).Enabled = False
  927.     Call Textwx(LrText(6))
  928.     
  929.     '编辑(新增、修改、删除)权限索引
  930.     Str_RightEdit = "Cwzz_kjkmsz_Edit"
  931.     
  932. End Sub
  933. Private Sub Cxnrtcwg()                               '查询内容填充网格
  934.     
  935.     Dim Sqlstr As String              '查询连接串
  936.     Dim Jsqte As Long                 '查询临时使用变量
  937.     
  938.     '为加快显示速度,将网格刷新动作冻结
  939.     CzxsGrid.Redraw = False
  940.     
  941.     '[>>查询连接串
  942.     Sqlstr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
  943.     " Gy_ForeignCurrency ON" & _
  944.     " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode order by Ccode"
  945.     '<<]
  946.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  947.     
  948.     With Cxnrrec
  949.         CzxsGrid.Rows = CzxsGrid.FixedRows
  950.         If .EOF And .BOF Then
  951.             CzxsGrid.Redraw = True
  952.             Exit Sub
  953.         End If
  954.         Jsqte = CzxsGrid.FixedRows
  955.         Do While Not .EOF
  956.             CzxsGrid.AddItem ""
  957.             Call Jltcwg(Cxnrrec, Jsqte)                              '调入填充网格子过程
  958.             CzxsGrid.RowHeight(Jsqte) = Sjhgd                        '设置网格高度
  959.             .MoveNext
  960.             Jsqte = Jsqte + 1
  961.         Loop
  962.     End With
  963.     
  964.     '将网格刷新动作解冻
  965.     CzxsGrid.Redraw = True
  966.     
  967. End Sub
  968. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  969.     
  970.     Dim Str_Fzhs As String      '辅助核算
  971.     
  972.     '[以下为自定义部分
  973.     With Jlbrec
  974.         
  975.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CClass"))
  976.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = .Fields("CodeLevel")
  977.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("CCode") & "")
  978.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("Cname") & "")
  979.         CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("ForeignCurrName") & "")
  980.         CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("Measure") & "")
  981.         CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("Cproperty") & "")
  982.         Str_Fzhs = ""
  983.         If .Fields("DeptFlag") Then
  984.             Str_Fzhs = Str_Fzhs + "部门 "
  985.         End If
  986.         If .Fields("CusFlag") Then
  987.             Str_Fzhs = Str_Fzhs + "客户 "
  988.         End If
  989.         If .Fields("SupplierFlag") Then
  990.             Str_Fzhs = Str_Fzhs + "供应商 "
  991.         End If
  992.         If .Fields("PersonFlag") Then
  993.             Str_Fzhs = Str_Fzhs + "个人 "
  994.         End If
  995.         If .Fields("ItemFlag") Then
  996.             Str_Fzhs = Str_Fzhs + "项目 "
  997.         End If
  998.         CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Trim(Str_Fzhs)
  999.         CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("AccFormat") & "")
  1000.         CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("BalanceOri") & "")
  1001.         CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("StopFlag") & "")
  1002.         CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("AssCode") & "")
  1003.         
  1004.     End With
  1005.     '以上为自定义部分]
  1006.     
  1007. End Sub
  1008. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  1009.     
  1010.     Set Cxnrrec = Nothing
  1011.     Set Rec_CodeSet = Nothing
  1012.     Unload Dyymctbl
  1013.     
  1014. End Sub
  1015. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  1016.     
  1017.     Dim Jsqte As Integer
  1018.     Dim Str_Parent As String   '上级科目号
  1019.     Dim CodeLength As Integer  '录入科目长度
  1020.     Dim CodeLev As Integer     '录入科目级次
  1021.     
  1022.     '对文本框录入内容进行为零和为空判断(固定不变)
  1023.     With Rec_CodeSet
  1024.         For Jsqte = 0 To Max_Text_Index
  1025.             If Textint(Jsqte, 8) = 1 Then     '字段不能为空
  1026.                 If Len(Trim(LrText(Jsqte).Text)) = 0 Then
  1027.                     Tsxx = Textstr(Jsqte, 7) & "不能为空!"
  1028.                     Call Xtxxts(Tsxx, 0, 1)
  1029.                     LrText(Jsqte).SetFocus
  1030.                     Bclrsj = False
  1031.                     Exit Function
  1032.                 End If
  1033.             Else
  1034.                 If Textint(Jsqte, 8) = 2 Then   '字段不能为零
  1035.                     If Val(Trim(LrText(Jsqte).Text)) = 0 Then
  1036.                         Tsxx = Textstr(Jsqte, 7) & "不能为零!"
  1037.                         Call Xtxxts(Tsxx, 0, 1)
  1038.                         LrText(Jsqte).SetFocus
  1039.                         Bclrsj = False
  1040.                         Exit Function
  1041.                     End If
  1042.                 End If
  1043.             End If
  1044.         Next Jsqte
  1045.         
  1046.         '如有外币核算,则外币栏不能为空
  1047.         If Chk_ForiFlag.Value = 1 Then
  1048.             If Len(Trim(LrText(2).Text)) = 0 Then
  1049.                 Tsxx = "科目进行外币核算,则外币项不能为空!"
  1050.                 Call Xtxxts(Tsxx, 0, 1)
  1051.                 LrText(2).SetFocus
  1052.                 Bclrsj = False
  1053.                 Exit Function
  1054.             End If
  1055.         End If
  1056.         
  1057.         '如有数量核算,则数量栏不能为空
  1058.         If Chk_QuatFlag.Value = 1 Then
  1059.             If Len(Trim(LrText(3).Text)) = 0 Then
  1060.                 Tsxx = "科目进行数量核算,则数量项不能为空!"
  1061.                 Call Xtxxts(Tsxx, 0, 1)
  1062.                 LrText(3).SetFocus
  1063.                 
  1064.                 Bclrsj = False
  1065.                 Exit Function
  1066.             End If
  1067.         End If
  1068.         
  1069.         '如有项目核算,则项目类别栏不能为空
  1070.         If Chk_Ass(3).Value = 1 Then
  1071.             If Len(Trim(LrText(4).Text)) = 0 Then
  1072.                 Tsxx = "科目进行项目核算,则项目类别项不能为空!"
  1073.                 Call Xtxxts(Tsxx, 0, 1)
  1074.                 LrText(4).SetFocus
  1075.                 Bclrsj = False
  1076.                 Exit Function
  1077.             End If
  1078.         End If
  1079.         
  1080.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  1081.         For Jsqte = 0 To Max_Text_Index
  1082.             If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
  1083.                 If Not TextYxxpd(Jsqte) Then
  1084.                     Exit Function
  1085.                 End If
  1086.             End If
  1087.         Next Jsqte
  1088.         
  1089.         If Lrzt = 1 Then  '增 加
  1090.             
  1091.             '判断科目编码是否符合规则,如有效则同时计算科目级次和上级科目编码
  1092.             For Jsqte = 1 To Int_CodeLev
  1093.                 If Int_CodeScheme(Jsqte) = Len(Trim(LrText(0).Text)) Then
  1094.                     CodeLev = Jsqte
  1095.                     Exit For
  1096.                 End If
  1097.             Next Jsqte
  1098.             If Jsqte <= CodeLev Then
  1099.                 If Jsqte > 1 Then
  1100.                     Str_Parent = Mid(Trim(LrText(0).Text), 1, Int_CodeScheme(Jsqte - 1))
  1101.                 Else
  1102.                     Str_Parent = ""
  1103.                 End If
  1104.             Else
  1105.                 Tsxx = "科目编码不符合编码规则!"
  1106.                 Call Xtxxts(Tsxx, 0, 1)
  1107.                 LrText(0).SetFocus
  1108.                 Bclrsj = False
  1109.                 Exit Function
  1110.             End If
  1111.             
  1112.             '判断此科目是否已建立上级科目
  1113.             If Str_Parent <> "" Then
  1114.                 Set Rec_CodeSet = Cw_DataEnvi.DataConnect.Execute("SELECT CCode,StopFlag FROM Cwzz_AccCode  Where CCode='" & Trim(Str_Parent) & "'")
  1115.                 If Rec_CodeSet.EOF Then
  1116.                     Tsxx = "请先建立其上级科目编码!"
  1117.                     Call Xtxxts(Tsxx, 0, 1)
  1118.                     LrText(0).Text = Str_Parent
  1119.                     LrText(0).SelStart = Len(LrText(0).Text)
  1120.                     LrText(0).SetFocus
  1121.                     Bclrsj = False
  1122.                     Exit Function
  1123.                 Else
  1124.                     If Rec_CodeSet.Fields("StopFlag") Then
  1125.                         Tsxx = "其上级科目编码已停用,不能建立下级科目!"
  1126.                         Call Xtxxts(Tsxx, 0, 1)
  1127.                         LrText(0).SetFocus
  1128.                         Bclrsj = False
  1129.                         Exit Function
  1130.                     End If
  1131.                 End If
  1132.                 Set RecTemp = Cw_DataEnvi.DataConnect.Execute("SELECT Top 1 CCode FROM Cwzz_AccVouchSub Where CCode='" & Trim(Str_Parent) & "'")
  1133.                 If Not RecTemp.EOF Then
  1134.                     Tsxx = "科目编码(" + Str_Parent + ")已使用,不能建立下级科目!"
  1135.                     Call Xtxxts(Tsxx, 0, 1)
  1136.                     LrText(0).SelStart = Len(LrText(0).Text)
  1137.                     LrText(0).SetFocus
  1138.                     Bclrsj = False
  1139.                     Exit Function
  1140.                 End If
  1141.             End If
  1142.             
  1143.             '[>>判断编码是否重复
  1144.             If .State = 1 Then .Close
  1145.             .Open "SELECT * FROM Cwzz_AccCode WHERE Ccode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1146.             If Not .EOF Then
  1147.                 Tsxx = "科目编码重复!"
  1148.                 Call Xtxxts(Tsxx, 0, 1)
  1149.                 LrText(0).SetFocus
  1150.                 Bclrsj = False
  1151.                 Exit Function
  1152.             End If
  1153.             
  1154.             '判断名称是否重复
  1155.             If .State = 1 Then .Close
  1156.             .Open "SELECT * FROM Cwzz_AccCode WHERE Cname= '" + Trim(LrText(1).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1157.             If Not .EOF Then
  1158.                 Tsxx = "科目名称重复!"
  1159.                 Call Xtxxts(Tsxx, 0, 1)
  1160.                 LrText(1).SetFocus
  1161.                 Bclrsj = False
  1162.                 Exit Function
  1163.             End If
  1164.             
  1165.             '判断助记码是否唯一
  1166.             If Trim(LrText(5).Text) <> "" Then
  1167.                 If .State = 1 Then .Close
  1168.                 .Open "SELECT * FROM Cwzz_AccCode WHERE AssCode= '" + Trim(LrText(5).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1169.                 If Not .EOF Then
  1170.                     Tsxx = "助记码不唯一!"
  1171.                     Call Xtxxts(Tsxx, 0, 1)
  1172.                     LrText(5).SetFocus
  1173.                     Bclrsj = False
  1174.                     Exit Function
  1175.                 End If
  1176.             End If
  1177.             
  1178.             '如果科目汇总打印则其汇总科目不能为空且为其上级科目
  1179.             If Chk_SumPrint.Value = 1 Then
  1180.                 If Len(Trim(LrText(6).Text)) = 0 Then
  1181.                     Tsxx = "科目进行汇总打印,则汇总科目不能为空!"
  1182.                     Call Xtxxts(Tsxx, 0, 1)
  1183.                     LrText(6).SetFocus
  1184.                     Bclrsj = False
  1185.                     Exit Function
  1186.                 Else
  1187.                     If InStr(1, Trim(LrText(0).Text), Trim(LrText(6).Text)) = 0 Then
  1188.                         Tsxx = "汇总打印科目必须为其上级科目!"
  1189.                         Call Xtxxts(Tsxx, 0, 1)
  1190.                         LrText(6).SetFocus
  1191.                         Bclrsj = False
  1192.                         Exit Function
  1193.                     End If
  1194.                     
  1195.                     '判断汇总科目是否存在
  1196.                     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where Ccode='" & Trim(LrText(6).Text) & "'")
  1197.                     
  1198.                     If RecTemp.EOF Then
  1199.                         Tsxx = "汇总打印科目不存在!"
  1200.                         Call Xtxxts(Tsxx, 0, 1)
  1201.                         LrText(6).SetFocus
  1202.                         Bclrsj = False
  1203.                         Exit Function
  1204.                     End If
  1205.                 End If
  1206.             End If
  1207.             
  1208.             '判断记录内容无误后,将记录内容写入数据表
  1209.             On Error GoTo Swcwcl
  1210.             
  1211.             Cw_DataEnvi.DataConnect.BeginTrans
  1212.             
  1213.             .AddNew
  1214.             .Fields("Cclass") = Combo_Class.Text           '科目类型
  1215.             .Fields("ParentCode") = Str_Parent             '上级科目编码
  1216.             .Fields("Ccode") = Trim(LrText(0).Text)        '科目编码
  1217.             .Fields("AssCode") = Trim(LrText(5).Text)      '助记码
  1218.             .Fields("Cname") = Trim(LrText(1).Text)        '科目名称
  1219.             .Fields("CodeLevel") = CodeLev                 '科目级次
  1220.             .Fields("CProperty") = Combo_Prop.Text         '科目性质
  1221.             .Fields("AccFormat") = Combo_AccFormat.Text    '帐页格式
  1222.             If Chk_ForiFlag.Value = 1 Then                 '外币
  1223.                 .Fields("ForeignFlag") = 1
  1224.                 .Fields("ForeignCurrCode") = Trim(LrText(2).Tag)
  1225.             Else
  1226.                 .Fields("ForeignFlag") = 0
  1227.                 .Fields("ForeignCurrCode") = Null
  1228.             End If
  1229.             If Chk_QuatFlag.Value = 1 Then                 '数量单位
  1230.                 .Fields("QuantityFlag") = 1
  1231.                 .Fields("Measure") = Trim(LrText(3).Text)
  1232.             Else
  1233.                 .Fields("QuantityFlag") = 0
  1234.                 .Fields("Measure") = ""
  1235.             End If
  1236.             If Chk_SumPrint.Value = 1 Then                 '汇总打印
  1237.                 .Fields("IIFSum") = 1
  1238.                 .Fields("cSumCode") = Trim(LrText(6).Text)
  1239.             Else
  1240.                 .Fields("IIFSum") = 1
  1241.                 .Fields("cSumCode") = Trim(LrText(6).Text)
  1242.             End If
  1243.             If Opt_Yefx(0) Then                            '余额方向
  1244.                 .Fields("BalanceOri") = "借"
  1245.             Else
  1246.                 .Fields("BalanceOri") = "贷"
  1247.             End If
  1248.             
  1249.             If Chk_Ass(0).Value = 1 Then                   '客户核算
  1250.                 .Fields("CusFlag") = 1
  1251.             Else
  1252.                 .Fields("CusFlag") = 0
  1253.             End If
  1254.             If Chk_Ass(4).Value = 1 Then                   '供应商核算
  1255.                 .Fields("SupplierFlag") = 1
  1256.             Else
  1257.                 .Fields("SupplierFlag") = 0
  1258.             End If
  1259.             If Chk_Ass(1).Value = 1 Then                   '部门核算
  1260.                 .Fields("DeptFlag") = 1
  1261.             Else
  1262.                 .Fields("DeptFlag") = 0
  1263.             End If
  1264.             If Chk_Ass(2).Value = 1 Then                   '个人核算
  1265.                 .Fields("PersonFlag") = 1
  1266.             Else
  1267.                 .Fields("PersonFlag") = 0
  1268.             End If
  1269.             If Chk_Ass(3).Value = 1 Then                   '项目核算
  1270.                 .Fields("ItemFlag") = 1
  1271.                 .Fields("ItemClassCode") = Trim(LrText(4).Tag)
  1272.             Else
  1273.                 .Fields("ItemFlag") = 0
  1274.                 .Fields("ItemClassCode") = Null
  1275.             End If
  1276.             If Chk_DayBookFlag.Value = 1 Then                 '日记帐
  1277.                 .Fields("DayBookFlag") = 1
  1278.             Else
  1279.                 .Fields("DayBookFlag") = 0
  1280.             End If
  1281.             If Chk_CashFlow.Value = 1 Then                 '现金或现金等价物
  1282.                 .Fields("CashFlowFlag") = 1
  1283.             Else
  1284.                 .Fields("CashFlowFlag") = 0
  1285.             End If
  1286.             .Fields("EndFlag") = 1                         '末级标志
  1287.             
  1288.             If ChkStopUse.Value = 1 Then                   '停用
  1289.                 .Fields("StopFlag") = 1
  1290.             Else
  1291.                 .Fields("StopFlag") = 0
  1292.             End If
  1293.           
  1294.             .Update
  1295.             
  1296.             '将上级科目末级标志置0
  1297.             
  1298.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Update Cwzz_AccCode Set Endflag=0 Where Ccode='" & Trim(Str_Parent) & "'")
  1299.             
  1300.             Cw_DataEnvi.DataConnect.CommitTrans
  1301.             
  1302.             Sqlstr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
  1303.             " Gy_ForeignCurrency ON" & _
  1304.             " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode WHERE Ccode= '" & Trim(LrText(0).Text) & "'"
  1305.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1306.             
  1307.             With CzxsGrid
  1308.                 .AddItem ""
  1309.                 .RowHeight(.Rows - 1) = Sjhgd
  1310.                 .Select .Rows - 1, Qslz
  1311.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  1312.             End With
  1313.             
  1314.             Tsxx = "保存完毕!"
  1315.             Call Xtxxts(Tsxx, 0, 4)
  1316.             Call Cshlrxx(1)
  1317.             LrText(0).SetFocus
  1318.             
  1319.             '将网格按科目编码排序
  1320.             With CzxsGrid
  1321.                 .Col = Sydz("003", GridStr(), Szzls)
  1322.                 CzxsGrid.Sort = flexSortStringAscending
  1323.             End With
  1324.             
  1325.         Else  '否则为修改记录
  1326.             
  1327.             If .State = 1 Then .Close
  1328.             .Open "SELECT * FROM Cwzz_AccCode WHERE Cname= '" + Trim(LrText(1).Text) + "' and CCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1329.             If Not .EOF Then
  1330.                 Tsxx = "科目名称重复!"
  1331.                 Call Xtxxts(Tsxx, 0, 1)
  1332.                 LrText(1).SetFocus
  1333.                 Bclrsj = False
  1334.                 Exit Function
  1335.             End If
  1336.             
  1337.             '判断助记码是否唯一
  1338.             If Trim(LrText(5).Text) <> "" Then
  1339.                 If .State = 1 Then .Close
  1340.                 .Open "SELECT * FROM Cwzz_AccCode WHERE AssCode= '" + Trim(LrText(5).Text) + "' and CCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1341.                 If Not .EOF Then
  1342.                     Tsxx = "助记码不唯一!"
  1343.                     Call Xtxxts(Tsxx, 0, 1)
  1344.                     LrText(5).SetFocus
  1345.                     Bclrsj = False
  1346.                     Exit Function
  1347.                 End If
  1348.             End If
  1349.             
  1350.             '如果科目汇总打印则其汇总科目不能为空且为其上级科目
  1351.             If Chk_SumPrint.Value = 1 Then
  1352.                 If Len(Trim(LrText(6).Text)) = 0 Then
  1353.                     Tsxx = "科目进行汇总打印,则汇总科目不能为空!"
  1354.                     Call Xtxxts(Tsxx, 0, 1)
  1355.                     LrText(6).SetFocus
  1356.                     Bclrsj = False
  1357.                     Exit Function
  1358.                 Else
  1359.                     If InStr(1, Trim(LrText(0).Text), Trim(LrText(6).Text)) = 0 Then
  1360.                         Tsxx = "汇总打印科目必须为其上级科目!"
  1361.                         Call Xtxxts(Tsxx, 0, 1)
  1362.                         LrText(6).SetFocus
  1363.                         Bclrsj = False
  1364.                         Exit Function
  1365.                     End If
  1366.                     
  1367.                     '判断汇总科目是否存在
  1368.                     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where Ccode='" & Trim(LrText(6).Text) & "'")
  1369.                     
  1370.                     If RecTemp.EOF Then
  1371.                         Tsxx = "汇总打印科目不存在!"
  1372.                         Call Xtxxts(Tsxx, 0, 1)
  1373.                         LrText(6).SetFocus
  1374.                         Bclrsj = False
  1375.                         Exit Function
  1376.                     End If
  1377.                 End If
  1378.             End If
  1379.             
  1380.             On Error GoTo Swcwcl
  1381.             
  1382.             Cw_DataEnvi.DataConnect.BeginTrans
  1383.             
  1384.             If .State = 1 Then .Close
  1385.             .Open "SELECT * FROM Cwzz_AccCode WHERE Ccode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1386.             If Not .EOF Then
  1387.                 .Fields("AssCode") = Trim(LrText(5).Text)      '助记码
  1388.                 .Fields("Cclass") = Combo_Class.Text           '科目类型
  1389.                 .Fields("Cname") = Trim(LrText(1).Text)        '科目名称
  1390.                 .Fields("CProperty") = Combo_Prop.Text         '科目性质
  1391.                 .Fields("AccFormat") = Combo_AccFormat.Text    '帐页格式
  1392.                 If Chk_ForiFlag.Value = 1 Then                 '外币
  1393.                     .Fields("ForeignFlag") = 1
  1394.                     .Fields("ForeignCurrCode") = Trim(LrText(2).Tag)
  1395.                 Else
  1396.                     .Fields("ForeignFlag") = 0
  1397.                     .Fields("ForeignCurrCode") = Null
  1398.                 End If
  1399.                 If Chk_QuatFlag.Value = 1 Then                 '数量单位
  1400.                     .Fields("QuantityFlag") = 1
  1401.                     .Fields("Measure") = Trim(LrText(3).Text)
  1402.                 Else
  1403.                     .Fields("QuantityFlag") = 0
  1404.                     .Fields("Measure") = ""
  1405.                 End If
  1406.                 If Chk_SumPrint.Value = 1 Then                 '汇总打印
  1407.                     .Fields("IIFSum") = 1
  1408.                     .Fields("cSumCode") = Trim(LrText(6).Text)
  1409.                 Else
  1410.                     .Fields("IIFSum") = 0
  1411.                     .Fields("cSumCode") = ""
  1412.                 End If
  1413.                 If Opt_Yefx(0) Then                            '余额方向
  1414.                     .Fields("BalanceOri") = "借"
  1415.                 Else
  1416.                     .Fields("BalanceOri") = "贷"
  1417.                 End If
  1418.                 
  1419.                 If Chk_Ass(0).Value = 1 Then                   '客户核算
  1420.                     .Fields("CusFlag") = 1
  1421.                 Else
  1422.                     .Fields("CusFlag") = 0
  1423.                 End If
  1424.                 
  1425.                 If Chk_Ass(4).Value = 1 Then                   '供应商核算
  1426.                     .Fields("SupplierFlag") = 1
  1427.                 Else
  1428.                     .Fields("SupplierFlag") = 0
  1429.                 End If
  1430.                 
  1431.                 If Chk_Ass(1).Value = 1 Then                   '部门核算
  1432.                     .Fields("DeptFlag") = 1
  1433.                 Else
  1434.                     .Fields("DeptFlag") = 0
  1435.                 End If
  1436.                 
  1437.                 If Chk_Ass(2).Value = 1 Then                   '个人核算
  1438.                     .Fields("PersonFlag") = 1
  1439.                 Else
  1440.                     .Fields("PersonFlag") = 0
  1441.                 End If
  1442.                 If Chk_Ass(3).Value = 1 Then                   '项目核算
  1443.                     .Fields("ItemFlag") = 1
  1444.                     .Fields("ItemClassCode") = Trim(LrText(4).Tag)
  1445.                 Else
  1446.                     .Fields("ItemFlag") = 0
  1447.                     .Fields("ItemClassCode") = Null
  1448.                 End If
  1449.                 
  1450.                 If ChkStopUse.Value = 1 Then                   '停用
  1451.                     .Fields("StopFlag") = 1
  1452.                 Else
  1453.                     .Fields("StopFlag") = 0
  1454.                 End If
  1455.                 
  1456.                 If Chk_DayBookFlag.Value = 1 Then                 '日记帐
  1457.                     .Fields("DayBookFlag") = 1
  1458.                 Else
  1459.                     .Fields("DayBookFlag") = 0
  1460.                 End If
  1461.                 
  1462.                 If Chk_CashFlow.Value = 1 Then                 '现金或现金等价物
  1463.                     .Fields("CashFlowFlag") = 1
  1464.                 Else
  1465.                     .Fields("CashFlowFlag") = 0
  1466.                 End If
  1467.                 
  1468.                 .Update
  1469.                 
  1470.                 '修改其下级科目科目类型
  1471.                 Sqlstr = "Update Cwzz_AccCode Set Cclass='" & Combo_Class.Text & "' Where Ccode Like  '" & Trim(LrText(0).Text) & "%'"
  1472.                 Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  1473.                 
  1474.             End If
  1475.             
  1476.             Cw_DataEnvi.DataConnect.CommitTrans
  1477.             
  1478.             Sqlstr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
  1479.             " Gy_ForeignCurrency ON" & _
  1480.             " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode WHERE Ccode= '" & Trim(LrText(0).Text) & "'"
  1481.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1482.             
  1483.             If Not Cxnrrec.EOF Then
  1484.                 With CzxsGrid
  1485.                     Call Jltcwg(Cxnrrec, .Row)
  1486.                 End With
  1487.             End If
  1488.             
  1489.         End If
  1490.         
  1491.         '保存记录成功,函数返回真值
  1492.         Bclrsj = True
  1493.         Exit Function
  1494.         
  1495.     End With
  1496.     
  1497. Swcwcl:
  1498.     
  1499.     Cw_DataEnvi.DataConnect.RollbackTrans
  1500.     
  1501.     Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  1502.     Call Xtxxts(Tsxx, 0, 1)
  1503.     
  1504.     Exit Function
  1505.     
  1506. End Function
  1507. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  1508.     
  1509.     TextChangeLock = True       '关闭文本框Chang事件
  1510.     
  1511.     If lrztxx = 1 Then
  1512.         
  1513.         '增加新记录时将文本框清空
  1514.         For Jsqte = 0 To Max_Text_Index
  1515.             If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  1516.                 LrText(Jsqte).Text = ""
  1517.                 LrText(Jsqte).Tag = ""
  1518.             End If
  1519.             TextValiJudgeLock(Jsqte) = True
  1520.         Next Jsqte
  1521.         
  1522.         '[>>
  1523.         '在此处可添加新增记录时初始化设置
  1524.         Chk_ForiFlag.Value = 0
  1525.         Chk_QuatFlag.Value = 0
  1526.         Chk_SumPrint.Value = 0
  1527.         ChkStopUse.Value = 0
  1528.         Opt_Yefx(0).Value = True
  1529.         For Jsqte = 0 To 3
  1530.             Chk_Ass(Jsqte).Value = 0
  1531.         Next Jsqte
  1532.         
  1533.         ChkStopUse.Enabled = False
  1534.         '<<]
  1535.     Else
  1536.         
  1537.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1538.         Sqlstr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName,Cwzz_ItemClass.ItemClassName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
  1539.         " Gy_ForeignCurrency ON" & _
  1540.         " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode LEFT OUTER JOIN" & _
  1541.         " Cwzz_ItemClass ON" & _
  1542.         " Cwzz_AccCode.ItemClassCode = Cwzz_ItemClass.ItemClassCode  Where CCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'"
  1543.         
  1544.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1545.         
  1546.         If Not RecTemp.EOF Then
  1547.             
  1548.             LrText(0).Text = Trim(RecTemp.Fields("Ccode"))                 '科目编码
  1549.             LrText(5).Text = Trim(RecTemp.Fields("AssCode") & "")          '助记码
  1550.             LrText(1).Text = Trim(RecTemp.Fields("Cname") & "")            '科目名称
  1551.             Combo_Class.Text = Trim(RecTemp.Fields("CClass"))              '科目类型
  1552.             Combo_Prop.Text = Trim(RecTemp.Fields("CProperty"))            '科目性质
  1553.             Combo_AccFormat = Trim(RecTemp.Fields("AccFormat"))            '帐页格式
  1554.             
  1555.             If RecTemp.Fields("ForeignFlag") Then
  1556.                 Chk_ForiFlag.Value = 1                                         '外币核算标志
  1557.                 LrText(2).Text = Trim(RecTemp.Fields("ForeignCurrName") & "")
  1558.                 LrText(2).Tag = Trim(RecTemp.Fields("ForeignCurrCode") & "")
  1559.                 Call Textyx(LrText(2))
  1560.                 Ydcommand1(2).Enabled = True
  1561.             Else
  1562.                 Chk_ForiFlag.Value = 0
  1563.                 LrText(2).Text = ""
  1564.                 LrText(2).Tag = ""
  1565.                 Call Textwx(LrText(2))
  1566.                 Ydcommand1(2).Enabled = False
  1567.             End If
  1568.             
  1569.             If RecTemp.Fields("QuantityFlag") Then
  1570.                 Chk_QuatFlag.Value = 1                                          '数量核算标志
  1571.                 LrText(3).Text = Trim(RecTemp.Fields("Measure") & "")
  1572.                 Call Textyx(LrText(3))
  1573.             Else
  1574.                 Chk_QuatFlag.Value = 0
  1575.                 Call Textwx(LrText(3))
  1576.                 LrText(3).Text = ""
  1577.             End If
  1578.             
  1579.             If RecTemp.Fields("IIFSum") Then
  1580.                 Chk_SumPrint.Value = 1                                          '汇总打印
  1581.                 LrText(6).Text = Trim(RecTemp.Fields("cSumCode") & "")
  1582.                 Call Textyx(LrText(6))
  1583.             Else
  1584.                 Chk_SumPrint.Value = 0
  1585.                 Call Textwx(LrText(6))
  1586.                 LrText(6).Text = ""
  1587.             End If
  1588.             
  1589.             If Trim(RecTemp.Fields("BalanceOri")) = "借" Then                  '余额方向
  1590.                 Opt_Yefx(0).Value = True
  1591.             Else
  1592.                 Opt_Yefx(1).Value = True
  1593.             End If
  1594.             
  1595.             If RecTemp.Fields("CusFlag") Then
  1596.                 Chk_Ass(0).Value = 1                                           '辅助核算(客户)
  1597.             Else
  1598.                 Chk_Ass(0).Value = 0
  1599.             End If
  1600.             
  1601.             If RecTemp.Fields("SupplierFlag") Then
  1602.                 Chk_Ass(4).Value = 1                                           '辅助核算(供应商)
  1603.             Else
  1604.                 Chk_Ass(4).Value = 0
  1605.             End If
  1606.             
  1607.             If RecTemp.Fields("DeptFlag") Then
  1608.                 Chk_Ass(1).Value = 1                                           '辅助核算(部门)
  1609.             Else
  1610.                 Chk_Ass(1).Value = 0
  1611.             End If
  1612.             
  1613.             If RecTemp.Fields("PersonFlag") Then
  1614.                 Chk_Ass(2).Value = 1                                           '辅助核算(个人)
  1615.             Else
  1616.                 Chk_Ass(2).Value = 0
  1617.             End If
  1618.             
  1619.             If RecTemp.Fields("ItemFlag") Then                                 '辅助核算(项目)
  1620.                 Chk_Ass(3).Value = 1
  1621.                 LrText(4).Text = Trim(RecTemp.Fields("ItemClassName") & "")
  1622.                 LrText(4).Tag = Trim(RecTemp.Fields("ItemClassCode") & "")
  1623.                 Call Textyx(LrText(4))
  1624.                 Ydcommand1(4).Enabled = True
  1625.             Else
  1626.                 Chk_Ass(3).Value = 0
  1627.                 LrText(4).Text = ""
  1628.                 LrText(4).Tag = ""
  1629.                 Call Textwx(LrText(4))
  1630.                 Ydcommand1(4).Enabled = False
  1631.             End If
  1632.             
  1633.             If RecTemp.Fields("DayBookFlag") Then                             '日记帐
  1634.                 Chk_DayBookFlag.Value = 1
  1635.             Else
  1636.                 Chk_DayBookFlag.Value = 0
  1637.             End If
  1638.             
  1639.             If RecTemp.Fields("CashFlowFlag") Then                             '现金或现金等价物
  1640.                 Chk_CashFlow.Value = 1
  1641.             Else
  1642.                 Chk_CashFlow.Value = 0
  1643.             End If
  1644.             
  1645.             If RecTemp.Fields("StopFlag") Then                                  '停用
  1646.                 ChkStopUse.Value = 1
  1647.             Else
  1648.                 ChkStopUse.Value = 0
  1649.             End If
  1650.             
  1651.             If RecTemp.Fields("EndFlag") Then                                   '停用是否有效
  1652.                 ChkStopUse.Enabled = True
  1653.             Else
  1654.                 ChkStopUse.Enabled = False
  1655.             End If
  1656.             
  1657.             
  1658.             
  1659.         Else
  1660.             Tsxx = "该科目已经被其他人删除,请刷新当前数据!"
  1661.             Call Xtxxts(Tsxx, 0, 4)
  1662.             Call Cancel
  1663.             TextChangeLock = False
  1664.             Exit Function
  1665.         End If
  1666.         
  1667.     End If
  1668.     
  1669.     Cshlrxx = True
  1670.     TextChangeLock = False
  1671.     
  1672. End Function
  1673. Private Sub Scdqjl()                 '删 除 当 前 记 录
  1674.     
  1675.     Dim Str_Parent As String
  1676.     Dim Yhanswer As Integer
  1677.     
  1678.     
  1679.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1680.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1681.          Exit Sub
  1682.     End If
  1683.     
  1684.     '非数据行不能删除
  1685.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1686.         Exit Sub
  1687.     End If
  1688.     
  1689.     '用户确认是否删除记录
  1690.     Tsxx = "请确认是否删除当前记录?"
  1691.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1692.     
  1693.     If Yhanswer = 2 Then
  1694.         Exit Sub
  1695.     End If
  1696.     
  1697.     '判断此科目是否存在下级科目,如存在则提示不能删除
  1698.     
  1699.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode  Where ParentCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'")
  1700.     
  1701.     If Not RecTemp.EOF Then
  1702.         Tsxx = "此科目存在下级科目,不能删除!"
  1703.         Call Xtxxts(Tsxx, 0, 1)
  1704.         Exit Sub
  1705.     End If
  1706.     
  1707.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select ParentCode From Cwzz_AccCode  Where CCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'")
  1708.     
  1709.     If Not RecTemp.EOF Then
  1710.         Str_Parent = Trim(RecTemp.Fields("ParentCode") & "")
  1711.     End If
  1712.     
  1713.     On Error GoTo Cwcl
  1714.     
  1715.     Cw_DataEnvi.DataConnect.BeginTrans
  1716.     
  1717.     '[以下需自定义部分
  1718.     
  1719.     Cw_DataEnvi.DataConnect.Execute "delete Cwzz_AccCode where CCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) + "'"
  1720.     
  1721.     '依情况修改上级科目末级标志
  1722.     
  1723.     If Str_Parent <> "" Then
  1724.         
  1725.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode  Where ParentCode='" & Str_Parent & "'")
  1726.         
  1727.         If RecTemp.EOF Then
  1728.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Update Cwzz_AccCode Set Endflag=1 Where Ccode='" & Trim(Str_Parent) & "'")
  1729.         End If
  1730.     End If
  1731.     
  1732.     '以上为自定义部分]
  1733.     Cw_DataEnvi.DataConnect.CommitTrans
  1734.     
  1735.     CzxsGrid.RemoveItem CzxsGrid.Row
  1736.     
  1737.     Exit Sub
  1738.     
  1739. Cwcl:
  1740.     
  1741.     Cw_DataEnvi.DataConnect.RollbackTrans
  1742.     
  1743.     If Err.Number = -2147217873 Then              '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1744.         Tsxx = "该编码已经被使用,不能删除!"
  1745.         Call Xtxxts(Tsxx, 0, 1)
  1746.         Exit Sub
  1747.     Else
  1748.         Tsxx = "出现未知情况,该编码不能被删除!"
  1749.         Call Xtxxts(Tsxx, 0, 1)
  1750.         Exit Sub
  1751.     End If
  1752.     
  1753. End Sub
  1754. '*******************以下区域为编写自定义过程区域**********************
  1755. Private Sub Chk_ForiFlag_Click()                 '单击外币核算标志
  1756.     
  1757.     If Chk_ForiFlag.Value = 1 Then
  1758.         Call Textyx(LrText(2))
  1759.         Ydcommand1(2).Enabled = True
  1760.     Else
  1761.         Call Textwx(LrText(2))
  1762.         Ydcommand1(2).Enabled = False
  1763.     End If
  1764.     
  1765. End Sub
  1766. Private Sub Chk_QuatFlag_Click()                 '单击数量核算标志
  1767.     
  1768.     If Chk_QuatFlag.Value = 1 Then
  1769.         Call Textyx(LrText(3))
  1770.     Else
  1771.         Call Textwx(LrText(3))
  1772.     End If
  1773.     
  1774. End Sub
  1775. Private Sub Chk_SumPrint_Click()                 '单击汇总打印
  1776.     
  1777.     If Chk_SumPrint.Value = 1 Then
  1778.         Call Textyx(LrText(6))
  1779.     Else
  1780.         Call Textwx(LrText(6))
  1781.     End If
  1782.     
  1783. End Sub
  1784. Private Sub Chk_Ass_Click(Index As Integer)      '单击项目核算标志
  1785.     
  1786.     If Chk_Ass(3).Value = 1 Then
  1787.         Call Textyx(LrText(4))
  1788.         Ydcommand1(4).Enabled = True
  1789.     Else
  1790.         Call Textwx(LrText(4))
  1791.         Ydcommand1(4).Enabled = False
  1792.     End If
  1793.     
  1794.     Select Case Index
  1795.     Case 0                 '客户往来
  1796.         If Chk_Ass(Index).Value = 1 Then
  1797.             Chk_Ass(2).Enabled = False
  1798.             Chk_Ass(4).Enabled = False
  1799.             If Chk_Ass(3).Value = 1 Then
  1800.                 Chk_Ass(1).Enabled = False
  1801.             End If
  1802.             If Chk_Ass(1).Value = 1 Then
  1803.                 Chk_Ass(3).Enabled = False
  1804.             End If
  1805.         Else
  1806.             Chk_Ass(1).Enabled = True
  1807.             Chk_Ass(2).Enabled = True
  1808.             Chk_Ass(3).Enabled = True
  1809.             Chk_Ass(4).Enabled = True
  1810.         End If
  1811.     Case 1                 '部门核算
  1812.         If Chk_Ass(Index).Value = 1 Then
  1813.             If Chk_Ass(0).Value = 1 Then
  1814.                 Chk_Ass(3).Enabled = False
  1815.                 Chk_Ass(4).Enabled = False
  1816.             End If
  1817.             
  1818.             If Chk_Ass(4).Value = 1 Then
  1819.                 Chk_Ass(0).Enabled = False
  1820.                 Chk_Ass(3).Enabled = False
  1821.             End If
  1822.             
  1823.             If Chk_Ass(2).Value = 1 Or Chk_Ass(3).Value = 1 Then
  1824.                 Chk_Ass(0).Enabled = False
  1825.                 Chk_Ass(4).Enabled = False
  1826.             End If
  1827.             
  1828.         Else
  1829.             If Chk_Ass(0).Value <> 1 And Chk_Ass(3).Value <> 1 And Chk_Ass(4).Value <> 1 Then
  1830.                 Chk_Ass(2).Enabled = True
  1831.             End If
  1832.             Chk_Ass(3).Enabled = True
  1833.             If Chk_Ass(0).Value <> 1 Then
  1834.                 Chk_Ass(4).Enabled = True
  1835.             End If
  1836.             If Chk_Ass(4).Value <> 1 Then
  1837.                 Chk_Ass(0).Enabled = True
  1838.             End If
  1839.             
  1840.             If Chk_Ass(3).Value = 1 And Chk_Ass(2).Value = 1 Then
  1841.                 Chk_Ass(0).Enabled = False
  1842.                 Chk_Ass(4).Enabled = False
  1843.             End If
  1844.             
  1845.         End If
  1846.     Case 2                 '个人往来
  1847.         If Chk_Ass(Index).Value <> 1 Then
  1848.             Chk_Ass(0).Enabled = True
  1849.             Chk_Ass(3).Enabled = True
  1850.             Chk_Ass(4).Enabled = True
  1851.         End If
  1852.         
  1853.         If (Chk_Ass(3).Value = 1 And Chk_Ass(1).Value = 1) Or Chk_Ass(Index).Value = 1 Then
  1854.             Chk_Ass(0).Enabled = False
  1855.             Chk_Ass(4).Enabled = False
  1856.         End If
  1857.         
  1858.     Case 3                 '项目核算
  1859.         If Chk_Ass(Index).Value = 1 Then
  1860.             
  1861.             If Chk_Ass(1).Value = 1 Or Chk_Ass(2).Value = 1 Then
  1862.                 Chk_Ass(0).Enabled = False
  1863.                 Chk_Ass(4).Enabled = False
  1864.             End If
  1865.             
  1866.             If Chk_Ass(0).Value = 1 Then
  1867.                 Chk_Ass(1).Enabled = False
  1868.                 Chk_Ass(4).Enabled = False
  1869.             End If
  1870.             
  1871.             If Chk_Ass(4).Value = 1 Then
  1872.                 Chk_Ass(0).Enabled = False
  1873.                 Chk_Ass(1).Enabled = False
  1874.             End If
  1875.         Else
  1876.             If Chk_Ass(0).Value <> 1 And Chk_Ass(4).Value <> 1 Then
  1877.                 Chk_Ass(2).Enabled = True
  1878.             End If
  1879.             Chk_Ass(1).Enabled = True
  1880.             If Chk_Ass(0).Value <> 1 Then
  1881.                 Chk_Ass(4).Enabled = True
  1882.             End If
  1883.             If Chk_Ass(4).Value <> 1 Then
  1884.                 Chk_Ass(0).Enabled = True
  1885.             End If
  1886.             
  1887.             If (Chk_Ass(1).Value = 1 And Chk_Ass(2) = 1) Or Chk_Ass(2).Value = 1 Then
  1888.                 Chk_Ass(0).Enabled = False
  1889.                 Chk_Ass(4).Enabled = False
  1890.             End If
  1891.             
  1892.         End If
  1893.     Case 4                 '供应商往来
  1894.         If Chk_Ass(Index).Value = 1 Then
  1895.             Chk_Ass(2).Enabled = False
  1896.             Chk_Ass(0).Enabled = False
  1897.             If Chk_Ass(3).Value = 1 Then
  1898.                 Chk_Ass(1).Enabled = False
  1899.             End If
  1900.             If Chk_Ass(1).Value = 1 Then
  1901.                 Chk_Ass(3).Enabled = False
  1902.             End If
  1903.         Else
  1904.             Chk_Ass(0).Enabled = True
  1905.             Chk_Ass(1).Enabled = True
  1906.             Chk_Ass(2).Enabled = True
  1907.             Chk_Ass(3).Enabled = True
  1908.         End If
  1909.     End Select
  1910.     
  1911. End Sub
  1912. Private Sub Combo_Class_Change()                       '根据类型改变余额方向
  1913.     
  1914.     If Combo_Class.ListIndex = 0 Or Combo_Class.ListIndex = 3 Then   '资产类和成本类余额方向一般为借方
  1915.         Opt_Yefx(0).Value = True
  1916.     Else
  1917.         Opt_Yefx(1).Value = True
  1918.     End If
  1919.     
  1920. End Sub
  1921. '*******************以上区域为编写自定义过程区域**********************
  1922. '*******************************以下为基本处理程序(固定不变)*******************************************'
  1923. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1924.     
  1925.     If Shift = 2 Then
  1926.         Select Case UCase(Chr(KeyCode))
  1927.         Case "P"                                                                          'Ctrl+P 打印
  1928.             If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1929.                 Call bbyl(False)
  1930.             End If
  1931.         Case "A"                                                                          'Ctrl+A 增加
  1932.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1933.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1934.                 Exit Sub
  1935.             End If
  1936.             If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1937.                 Call Toolbjzt
  1938.                 Lrzt = 1
  1939.                 Call Cshlrxx(Lrzt)
  1940.                 LrText(0).SetFocus
  1941.                 LrText(0).Locked = False
  1942.             End If
  1943.         Case "D"                                                                          'Ctrl+D 删除
  1944.             If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1945.                 Call Scdqjl
  1946.             End If
  1947.         End Select
  1948.     End If
  1949.     
  1950. End Sub
  1951. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1952.     
  1953.     Select Case Button.Key
  1954.     Case "ymsz"                                          '页面设置
  1955.         Dyymctbl.Show 1
  1956.     Case "yl"                                            '预 览
  1957.         Call bbyl(True)
  1958.     Case "dy"                                            '打 印
  1959.         Call bbyl(False)
  1960.     Case "zj"                                            '增 加
  1961.     
  1962.         '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1963.         If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1964.             Exit Sub
  1965.         End If
  1966.         
  1967.         Call Toolbjzt
  1968.         Lrzt = 1
  1969.         Call Cshlrxx(Lrzt)
  1970.         LrText(0).SetFocus
  1971.         LrText(0).Locked = False
  1972.     Case "dw"                                            '定 位
  1973.         JC_FrmKmdw.Show 1
  1974.         If Xtfhcs <> "" Then
  1975.             With CzxsGrid
  1976.                 For Jsqte = .FixedRows To .Rows - 1
  1977.                     If Mid(.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)), 1, Len(Xtfhcs)) = Xtfhcs Then
  1978.                         .Select Jsqte, Sydz("003", GridStr(), Szzls)
  1979.                         .TopRow = Jsqte
  1980.                         Exit For
  1981.                     End If
  1982.                 Next Jsqte
  1983.             End With
  1984.         End If
  1985.     Case "xg"                                            '修 改
  1986.         Call Xgdqjl
  1987.     Case "sc"                                            '删 除
  1988.         Call Scdqjl
  1989.     Case "sx"                                            '刷 新
  1990.         Call Cxnrtcwg
  1991.     Case "bz"                                            '帮 助
  1992.         Call F1bz
  1993.     Case "fh"                                            '退 出
  1994.         Unload Me
  1995.     End Select
  1996.     
  1997. End Sub
  1998. Private Sub CzxsGrid_DblClick()                                         '修改当前编码记录
  1999.     
  2000.     Call Xgdqjl
  2001.     
  2002. End Sub
  2003. Private Sub Xgdqjl()                                                    '修改当前编码记录
  2004.     
  2005.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  2006.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  2007.         BcCommand.Enabled = False
  2008.     End If
  2009.     
  2010.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  2011.         Exit Sub
  2012.     End If
  2013.     
  2014.     Call Toolbjzt
  2015.     Lrzt = 2
  2016.     
  2017.     If Cshlrxx(Lrzt) Then
  2018.         LrText(1).SetFocus
  2019.         LrText(0).Locked = True
  2020.     End If
  2021.     
  2022. End Sub
  2023. Private Sub Toolbjzt()                                                  'Toolbar状态(编辑状态)
  2024.     
  2025.     StTab.TabEnabled(1) = True
  2026.     StTab.Tab = 1
  2027.     Frame1.Enabled = True
  2028.     StTab.TabEnabled(0) = False
  2029.     CzxsGrid.Enabled = False
  2030.     
  2031.     With SzToolbar
  2032.         .Buttons("ymsz").Enabled = False
  2033.         .Buttons("dy").Enabled = False
  2034.         .Buttons("yl").Enabled = False
  2035.         .Buttons("zj").Enabled = False
  2036.         .Buttons("xg").Enabled = False
  2037.         .Buttons("sc").Enabled = False
  2038.         .Buttons("sx").Enabled = False
  2039.         .Buttons("dw").Enabled = False
  2040.     End With
  2041.     
  2042. End Sub
  2043. Private Sub Toolfbjzt()                                                 'Toolbar状态(非编辑状态)
  2044.     
  2045.     StTab.TabEnabled(0) = True
  2046.     StTab.Tab = 0
  2047.     CzxsGrid.Enabled = True
  2048.     Frame1.Enabled = False
  2049.     StTab.TabEnabled(1) = False
  2050.     Lrzt = 0
  2051.     
  2052.     With SzToolbar
  2053.         .Buttons("ymsz").Enabled = True
  2054.         .Buttons("dy").Enabled = True
  2055.         .Buttons("yl").Enabled = True
  2056.         .Buttons("zj").Enabled = True
  2057.         .Buttons("xg").Enabled = True
  2058.         .Buttons("sc").Enabled = True
  2059.         .Buttons("sx").Enabled = True
  2060.         .Buttons("dw").Enabled = True
  2061.     End With
  2062.     
  2063. End Sub
  2064. Private Sub BcCommand_Click()                                           '保 存
  2065.     
  2066.     If Not Bclrsj Then
  2067.         Exit Sub
  2068.     End If
  2069.     
  2070.     If Lrzt = 2 Then
  2071.         Call Toolfbjzt
  2072.     End If
  2073.     
  2074. End Sub
  2075. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)       '取消
  2076.     
  2077.     '避免执行Click程序
  2078.     Bln_Cancel = True
  2079.     
  2080.     Call Cancel
  2081.     
  2082. End Sub
  2083. Private Sub QxCommand_Click()                                           '取消
  2084.     
  2085.     If Bln_Cancel Then
  2086.         Bln_Cancel = False
  2087.         Exit Sub
  2088.     End If
  2089.     
  2090.     Call Cancel
  2091.     
  2092. End Sub
  2093. Private Sub Cancel()                                                    '取消
  2094.     
  2095.     '文本框加锁
  2096.     For Jsqte = 0 To Max_Text_Index
  2097.         TextValiJudgeLock(Jsqte) = True
  2098.     Next Jsqte
  2099.     
  2100.     Call Toolfbjzt
  2101.     
  2102. End Sub
  2103. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  2104.     
  2105.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  2106.     
  2107. End Sub
  2108. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  2109.     
  2110.     Select Case Button.Key
  2111.     Case "bcgs"                                       '保存表格格式
  2112.         Call Bcwggs(CzxsGrid, GridCode, GridStr())
  2113.     Case "hfmrgs"                                     '恢复默认格式
  2114.         Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  2115.     Case "szxsxm"                                     '设置显示项目
  2116.         Call Szxsxm(CzxsGrid, GridCode)
  2117.     End Select
  2118.     
  2119. End Sub
  2120. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  2121.     
  2122.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  2123.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  2124.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  2125.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  2126.     ReDim Bbxbt(1 To Bbxbtgs)
  2127.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  2128.     
  2129.     If Bbbwhgs <> 0 Then
  2130.         ReDim Bbbwh(1 To Bbbwhgs)
  2131.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  2132.     End If
  2133.     
  2134.     Bbzbt = ReportTitle
  2135.     Bbxbt(1) = " "
  2136.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  2137.     
  2138.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  2139.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  2140.     
  2141.     If Not bbylte Then
  2142.         Unload DY_Tybbyldy
  2143.     End If
  2144.     
  2145. End Sub
  2146. '************以下为文本框录入处理程序(固定不变部分)*************'
  2147. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  2148.     
  2149.     '以下为依据实际情况自定义部分[
  2150.     
  2151.     '在此填写文本框录入事后处理程序
  2152.     
  2153.     ']以上为依据实际情况自定义部分
  2154.     
  2155. End Sub
  2156. Private Sub LrText_Change(Index As Integer)
  2157.     
  2158.     '屏蔽程序改变控制
  2159.     If TextChangeLock Then
  2160.         Exit Sub
  2161.     End If
  2162.     
  2163.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  2164.     
  2165.     '限制字段录入长度
  2166.     
  2167.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  2168.     
  2169.     Select Case Textint(Index, 1)
  2170.     Case 8, 11       '金额型
  2171.         Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  2172.     Case 9, 12       '数量型
  2173.         Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  2174.     Case 10          '单价型
  2175.         Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  2176.     Case Else        '其他小数类型控制
  2177.         If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  2178.             Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  2179.         End If
  2180.     End Select
  2181.     
  2182.     '自动调入上级科目科目名称
  2183.     Select Case Index
  2184.     Case 0
  2185.         For Jsqte = 1 To Int_CodeLev
  2186.             If Int_CodeScheme(Jsqte) = Len(Trim(LrText(0).Text)) Then
  2187.                 CodeLev = Jsqte
  2188.                 Exit For
  2189.             End If
  2190.         Next Jsqte
  2191.         If Jsqte <= CodeLev Then
  2192.             If Jsqte > 1 Then
  2193.                 Str_Parent = Mid(Trim(LrText(0).Text), 1, Int_CodeScheme(Jsqte - 1))
  2194.             Else
  2195.                 Str_Parent = ""
  2196.             End If
  2197.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute("SELECT CCode,Cname FROM Cwzz_AccCode  Where CCode='" & Trim(Str_Parent) & "'")
  2198.             If Not RecTemp.EOF Then
  2199.                 LrText(1).Text = Trim(RecTemp.Fields("Cname")) + "/"
  2200.             End If
  2201.         Else
  2202.             LrText(1).Text = ""
  2203.         End If
  2204.         
  2205.         If Val(Mid(LrText(0).Text, 1)) <= 5 And Val(Mid(LrText(0).Text, 1)) >= 1 Then
  2206.             Combo_Class.Text = Combo_Class.List(Val(Mid(LrText(0).Text, 1)) - 1)
  2207.         End If
  2208.     End Select
  2209.     
  2210.     TextChangeLock = False '解锁
  2211.     
  2212. End Sub
  2213. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  2214.     
  2215.     Call TextShow(Index)
  2216.     CurTextIndex = Index
  2217.     LrText(Index).SelStart = Len(LrText(Index))
  2218.     
  2219. End Sub
  2220. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  2221.     
  2222.     Select Case KeyCode
  2223.     Case vbKeyF2
  2224.         Call Text_Help(Index)
  2225.     End Select
  2226.     
  2227. End Sub
  2228. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  2229.     
  2230.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  2231.     
  2232. End Sub
  2233. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  2234.     
  2235.     '显示相应信息但不能进行有效性判断
  2236.     
  2237. End Sub
  2238. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  2239.     
  2240.     Call Text_Help(Index)
  2241.     
  2242. End Sub
  2243. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  2244.     
  2245.     If Not Textboolean(Index, 1) Then
  2246.         Exit Sub
  2247.     End If
  2248.     
  2249.     '调用帮助
  2250.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  2251.     
  2252.     '根据设置选择显示编码和名称,并进行存储
  2253.     If Len(Xtfhcs) <> 0 Then
  2254.         If Textint(Index, 3) = 1 Then
  2255.             LrText(Index).Text = Xtfhcsfz
  2256.             LrText(Index).Tag = Xtfhcs
  2257.         Else
  2258.             LrText(Index).Text = Xtfhcs
  2259.             LrText(Index).Tag = Xtfhcsfz
  2260.         End If
  2261.     End If
  2262.     
  2263.     LrText(Index).SetFocus
  2264.     
  2265. End Sub
  2266. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  2267.     
  2268.     '填写文本框得到焦点,进行相应信息处理程序
  2269.     
  2270. End Sub
  2271. Private Sub Wbkcsh()                          '录入文本框初始化
  2272.     
  2273.     Dim Jsqte As Integer
  2274.     
  2275.     '最大录入文本框索引值
  2276.     Max_Text_Index = Textvar(1)
  2277.     
  2278.     ReDim TextValiJudgeLock(Max_Text_Index)
  2279.     
  2280.     For Jsqte = 0 To Max_Text_Index
  2281.         If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  2282.             If Textboolean(Jsqte, 1) Then
  2283.                 If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
  2284.                     Load Ydcommand1(Jsqte)
  2285.                 End If
  2286.                 Ydcommand1(Jsqte).Visible = True
  2287.                 Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
  2288.             End If
  2289.             
  2290.             TextChangeLock = True
  2291.             LrText(Jsqte).Text = ""
  2292.             LrText(Jsqte).Tag = ""
  2293.             
  2294.             If Textint(Jsqte, 5) <> 0 Then
  2295.                 LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
  2296.             End If
  2297.             
  2298.             TextChangeLock = False
  2299.         End If
  2300.         
  2301.         TextValiJudgeLock(Jsqte) = True
  2302.     Next Jsqte
  2303.     
  2304. End Sub
  2305. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  2306.     
  2307.     Dim Sqlstr As String
  2308.     Dim Findrec As ADODB.Recordset
  2309.     
  2310.     '文本框内容未曾改变不进行有效性判断
  2311.     If TextValiJudgeLock(Index) Then
  2312.         TextYxxpd = True
  2313.         Exit Function
  2314.     End If
  2315.     
  2316.     '文本框内容为空认为有效,并清空其Tag值
  2317.     If Trim(LrText(Index)) = "" Then
  2318.         LrText(Index).Tag = ""
  2319.         Call Wbklrwbcl(Index)
  2320.         TextValiJudgeLock(Index) = True
  2321.         TextYxxpd = True
  2322.         Exit Function
  2323.     End If
  2324.     
  2325.     '可在此加入不做有效性判断的理由
  2326.     
  2327.     '1.外币核算
  2328.     If Index = 2 Then
  2329.         If Chk_ForiFlag.Value = 0 Then
  2330.             TextYxxpd = True
  2331.             Exit Function
  2332.         End If
  2333.     End If
  2334.     
  2335.     '2.项目核算
  2336.     If Index = 4 Then
  2337.         If Chk_Ass(3).Value = 0 Then
  2338.             TextYxxpd = True
  2339.             Exit Function
  2340.         End If
  2341.     End If
  2342.     
  2343.     Select Case Textint(Index, 4)
  2344.     Case 1      '编码型
  2345.         Sqlstr = Trim(Textstr(Index, 5))
  2346.         Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  2347.         Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  2348.         
  2349.         If Findrec.EOF Then
  2350.             Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  2351.             LrText(Index).SetFocus
  2352.             Exit Function
  2353.         Else
  2354.             Select Case Textint(Index, 3)
  2355.             Case 0
  2356.                 
  2357.                 If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2358.                     LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2359.                 End If
  2360.                 
  2361.                 If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2362.                     LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2363.                 End If
  2364.                 
  2365.             Case 1
  2366.                 
  2367.                 If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2368.                     LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2369.                 End If
  2370.                 
  2371.                 If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2372.                     LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2373.                 End If
  2374.             End Select
  2375.         End If
  2376.         
  2377.     Case 2      '日期型
  2378.         If IsDate(LrText(Index).Text) Then
  2379.             LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  2380.             If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  2381.                 LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  2382.             End If
  2383.         Else
  2384.             Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  2385.             Call Xtxxts(Tsxx, 0, 1)
  2386.             LrText(Index).SetFocus
  2387.             Exit Function
  2388.         End If
  2389.         
  2390.     Case 3      '其他类型
  2391.         
  2392.     End Select
  2393.     
  2394.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  2395.     TextValiJudgeLock(Index) = True
  2396.     
  2397.     '调用文本框事后处理程序
  2398.     Call Wbklrwbcl(Index)
  2399.     
  2400.     '有效性判断通过则返回True
  2401.     TextYxxpd = True
  2402.     
  2403. End Function