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

企业管理

开发平台:

Visual Basic

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