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

企业管理

开发平台:

Visual Basic

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