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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form Cg_PlanListQuery 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "采购计划列表查询条件"
  6.    ClientHeight    =   4725
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4800
  10.    HelpContextID   =   1103003
  11.    Icon            =   "采购系统_采购计划列表查询条件.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4725
  17.    ScaleWidth      =   4800
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   1  '所有者中心
  20.    Begin VB.CommandButton Cmd_Clear 
  21.       Caption         =   "全清"
  22.       Height          =   300
  23.       Left            =   60
  24.       TabIndex        =   13
  25.       Top             =   4350
  26.       Width           =   1120
  27.    End
  28.    Begin VB.CommandButton QxCommand 
  29.       Caption         =   "取消(&C)"
  30.       Height          =   300
  31.       Left            =   3600
  32.       TabIndex        =   12
  33.       Top             =   4350
  34.       Width           =   1120
  35.    End
  36.    Begin VB.CommandButton QdCommand 
  37.       Caption         =   "确定(&O)"
  38.       Height          =   300
  39.       Left            =   2400
  40.       TabIndex        =   11
  41.       Top             =   4350
  42.       Width           =   1120
  43.    End
  44.    Begin VB.CheckBox UnloadCheck 
  45.       Caption         =   "卸载窗体"
  46.       Height          =   615
  47.       Left            =   6000
  48.       TabIndex        =   14
  49.       Top             =   1200
  50.       Width           =   825
  51.    End
  52.    Begin TabDlg.SSTab SSTab1 
  53.       Height          =   4185
  54.       Left            =   60
  55.       TabIndex        =   15
  56.       Top             =   90
  57.       Width           =   4665
  58.       _ExtentX        =   8229
  59.       _ExtentY        =   7382
  60.       _Version        =   393216
  61.       Style           =   1
  62.       Tabs            =   2
  63.       TabsPerRow      =   2
  64.       TabHeight       =   520
  65.       TabCaption(0)   =   "基本条件"
  66.       TabPicture(0)   =   "采购系统_采购计划列表查询条件.frx":1042
  67.       Tab(0).ControlEnabled=   -1  'True
  68.       Tab(0).Control(0)=   "Frame1"
  69.       Tab(0).Control(0).Enabled=   0   'False
  70.       Tab(0).ControlCount=   1
  71.       TabCaption(1)   =   "辅助条件"
  72.       TabPicture(1)   =   "采购系统_采购计划列表查询条件.frx":105E
  73.       Tab(1).ControlEnabled=   0   'False
  74.       Tab(1).Control(0)=   "Frame5"
  75.       Tab(1).Control(0).Enabled=   0   'False
  76.       Tab(1).ControlCount=   1
  77.       Begin VB.Frame Frame5 
  78.          Height          =   3735
  79.          Left            =   -74910
  80.          TabIndex        =   38
  81.          Top             =   360
  82.          Width           =   4485
  83.          Begin VB.Frame Frame6 
  84.             Caption         =   "关闭状态"
  85.             Height          =   525
  86.             Left            =   240
  87.             TabIndex        =   50
  88.             Top             =   2070
  89.             Width           =   4095
  90.             Begin VB.OptionButton Opt_Close 
  91.                Caption         =   "已关闭"
  92.                Height          =   225
  93.                Index           =   2
  94.                Left            =   2880
  95.                TabIndex        =   53
  96.                Top             =   210
  97.                Width           =   855
  98.             End
  99.             Begin VB.OptionButton Opt_Close 
  100.                Caption         =   "未关闭"
  101.                Height          =   225
  102.                Index           =   1
  103.                Left            =   1560
  104.                TabIndex        =   52
  105.                Top             =   210
  106.                Width           =   855
  107.             End
  108.             Begin VB.OptionButton Opt_Close 
  109.                Caption         =   "全部"
  110.                Height          =   225
  111.                Index           =   0
  112.                Left            =   240
  113.                TabIndex        =   51
  114.                Top             =   210
  115.                Value           =   -1  'True
  116.                Width           =   855
  117.             End
  118.          End
  119.          Begin VB.ComboBox Cmb_PlanType 
  120.             Height          =   300
  121.             Left            =   1320
  122.             Style           =   2  'Dropdown List
  123.             TabIndex        =   47
  124.             Top             =   240
  125.             Width           =   3025
  126.          End
  127.          Begin VB.CommandButton Ydcommand1 
  128.             Height          =   300
  129.             Index           =   10
  130.             Left            =   4035
  131.             Picture         =   "采购系统_采购计划列表查询条件.frx":107A
  132.             Style           =   1  'Graphical
  133.             TabIndex        =   42
  134.             Top             =   1740
  135.             Visible         =   0   'False
  136.             Width           =   300
  137.          End
  138.          Begin VB.CommandButton Ydcommand1 
  139.             Height          =   300
  140.             Index           =   9
  141.             Left            =   4035
  142.             Picture         =   "采购系统_采购计划列表查询条件.frx":1404
  143.             Style           =   1  'Graphical
  144.             TabIndex        =   41
  145.             Top             =   1365
  146.             Visible         =   0   'False
  147.             Width           =   300
  148.          End
  149.          Begin VB.TextBox LrText 
  150.             Height          =   300
  151.             Index           =   10
  152.             Left            =   1320
  153.             TabIndex        =   10
  154.             Text            =   "10"
  155.             Top             =   1740
  156.             Width           =   2715
  157.          End
  158.          Begin VB.CommandButton Ydcommand1 
  159.             Height          =   300
  160.             Index           =   8
  161.             Left            =   4035
  162.             Picture         =   "采购系统_采购计划列表查询条件.frx":178E
  163.             Style           =   1  'Graphical
  164.             TabIndex        =   40
  165.             Top             =   990
  166.             Visible         =   0   'False
  167.             Width           =   300
  168.          End
  169.          Begin VB.TextBox LrText 
  170.             Height          =   300
  171.             Index           =   9
  172.             Left            =   1320
  173.             TabIndex        =   9
  174.             Text            =   "9"
  175.             Top             =   1365
  176.             Width           =   2715
  177.          End
  178.          Begin VB.CommandButton Ydcommand1 
  179.             Height          =   300
  180.             Index           =   7
  181.             Left            =   4035
  182.             Picture         =   "采购系统_采购计划列表查询条件.frx":1B18
  183.             Style           =   1  'Graphical
  184.             TabIndex        =   39
  185.             Top             =   615
  186.             Visible         =   0   'False
  187.             Width           =   300
  188.          End
  189.          Begin VB.TextBox LrText 
  190.             Height          =   300
  191.             Index           =   8
  192.             Left            =   1320
  193.             TabIndex        =   8
  194.             Text            =   "8"
  195.             Top             =   990
  196.             Width           =   2715
  197.          End
  198.          Begin VB.TextBox LrText 
  199.             Height          =   300
  200.             Index           =   7
  201.             Left            =   1320
  202.             TabIndex        =   7
  203.             Text            =   "7"
  204.             Top             =   615
  205.             Width           =   2715
  206.          End
  207.          Begin VB.Label Label1 
  208.             Caption         =   "计划类型:"
  209.             Height          =   255
  210.             Index           =   10
  211.             Left            =   240
  212.             TabIndex        =   49
  213.             Top             =   270
  214.             Width           =   915
  215.          End
  216.          Begin VB.Label Label1 
  217.             Caption         =   "供应商:"
  218.             Height          =   255
  219.             Index           =   6
  220.             Left            =   240
  221.             TabIndex        =   48
  222.             Top             =   638
  223.             Width           =   915
  224.          End
  225.          Begin VB.Label Label1 
  226.             Caption         =   "采购员:"
  227.             Height          =   255
  228.             Index           =   9
  229.             Left            =   240
  230.             TabIndex        =   46
  231.             Top             =   1763
  232.             Width           =   915
  233.          End
  234.          Begin VB.Label Label1 
  235.             Caption         =   "计划人:"
  236.             Height          =   255
  237.             Index           =   8
  238.             Left            =   240
  239.             TabIndex        =   45
  240.             Top             =   1388
  241.             Width           =   915
  242.          End
  243.          Begin VB.Label Label1 
  244.             Caption         =   "计划部门:"
  245.             Height          =   255
  246.             Index           =   7
  247.             Left            =   240
  248.             TabIndex        =   44
  249.             Top             =   1013
  250.             Width           =   915
  251.          End
  252.       End
  253.       Begin VB.Frame Frame1 
  254.          Height          =   3735
  255.          Left            =   90
  256.          TabIndex        =   16
  257.          Top             =   360
  258.          Width           =   4485
  259.          Begin VB.CommandButton Ydcommand1 
  260.             Height          =   300
  261.             Index           =   6
  262.             Left            =   4005
  263.             Picture         =   "采购系统_采购计划列表查询条件.frx":1EA2
  264.             Style           =   1  'Graphical
  265.             TabIndex        =   43
  266.             Top             =   1710
  267.             Visible         =   0   'False
  268.             Width           =   300
  269.          End
  270.          Begin VB.Frame Frame4 
  271.             Caption         =   "下达状态"
  272.             Height          =   525
  273.             Left            =   150
  274.             TabIndex        =   34
  275.             Top             =   3120
  276.             Width           =   4155
  277.             Begin VB.OptionButton Opt_Exec 
  278.                Caption         =   "已下达"
  279.                Height          =   255
  280.                Index           =   2
  281.                Left            =   2760
  282.                TabIndex        =   37
  283.                Top             =   210
  284.                Width           =   1095
  285.             End
  286.             Begin VB.OptionButton Opt_Exec 
  287.                Caption         =   "未下达"
  288.                Height          =   255
  289.                Index           =   1
  290.                Left            =   1560
  291.                TabIndex        =   36
  292.                Top             =   210
  293.                Width           =   975
  294.             End
  295.             Begin VB.OptionButton Opt_Exec 
  296.                Caption         =   "全部"
  297.                Height          =   255
  298.                Index           =   0
  299.                Left            =   180
  300.                TabIndex        =   35
  301.                Top             =   210
  302.                Width           =   735
  303.             End
  304.          End
  305.          Begin VB.Frame Frame3 
  306.             Caption         =   "是否紧急计划"
  307.             Height          =   525
  308.             Left            =   150
  309.             TabIndex        =   30
  310.             Top             =   2040
  311.             Width           =   4155
  312.             Begin VB.OptionButton Opt_JJPlan 
  313.                Caption         =   "紧急"
  314.                Height          =   255
  315.                Index           =   2
  316.                Left            =   2760
  317.                TabIndex        =   33
  318.                Top             =   210
  319.                Width           =   975
  320.             End
  321.             Begin VB.OptionButton Opt_JJPlan 
  322.                Caption         =   "正常"
  323.                Height          =   255
  324.                Index           =   1
  325.                Left            =   1560
  326.                TabIndex        =   32
  327.                Top             =   210
  328.                Width           =   975
  329.             End
  330.             Begin VB.OptionButton Opt_JJPlan 
  331.                Caption         =   "全部"
  332.                Height          =   255
  333.                Index           =   0
  334.                Left            =   180
  335.                TabIndex        =   31
  336.                Top             =   210
  337.                Width           =   975
  338.             End
  339.          End
  340.          Begin VB.CommandButton Ydcommand1 
  341.             Height          =   300
  342.             Index           =   5
  343.             Left            =   4005
  344.             Picture         =   "采购系统_采购计划列表查询条件.frx":222C
  345.             Style           =   1  'Graphical
  346.             TabIndex        =   29
  347.             Top             =   1341
  348.             Visible         =   0   'False
  349.             Width           =   300
  350.          End
  351.          Begin VB.CommandButton Ydcommand1 
  352.             Height          =   300
  353.             Index           =   4
  354.             Left            =   3720
  355.             Picture         =   "采购系统_采购计划列表查询条件.frx":25B6
  356.             Style           =   1  'Graphical
  357.             TabIndex        =   28
  358.             Top             =   2220
  359.             Visible         =   0   'False
  360.             Width           =   300
  361.          End
  362.          Begin VB.CommandButton Ydcommand1 
  363.             Height          =   300
  364.             Index           =   1
  365.             Left            =   2640
  366.             Picture         =   "采购系统_采购计划列表查询条件.frx":2940
  367.             Style           =   1  'Graphical
  368.             TabIndex        =   27
  369.             Top             =   2220
  370.             Visible         =   0   'False
  371.             Width           =   300
  372.          End
  373.          Begin VB.CommandButton Ydcommand1 
  374.             Height          =   300
  375.             Index           =   0
  376.             Left            =   2400
  377.             Picture         =   "采购系统_采购计划列表查询条件.frx":2CCA
  378.             Style           =   1  'Graphical
  379.             TabIndex        =   26
  380.             Top             =   2220
  381.             Visible         =   0   'False
  382.             Width           =   300
  383.          End
  384.          Begin VB.TextBox LrText 
  385.             Height          =   300
  386.             Index           =   6
  387.             Left            =   1320
  388.             TabIndex        =   6
  389.             Text            =   "6"
  390.             Top             =   1710
  391.             Width           =   2670
  392.          End
  393.          Begin VB.TextBox LrText 
  394.             Height          =   300
  395.             Index           =   5
  396.             Left            =   1320
  397.             TabIndex        =   5
  398.             Text            =   "5"
  399.             Top             =   1341
  400.             Width           =   2670
  401.          End
  402.          Begin VB.CommandButton Ydcommand1 
  403.             Height          =   300
  404.             Index           =   2
  405.             Left            =   2380
  406.             Picture         =   "采购系统_采购计划列表查询条件.frx":3054
  407.             Style           =   1  'Graphical
  408.             TabIndex        =   22
  409.             Top             =   607
  410.             Visible         =   0   'False
  411.             Width           =   300
  412.          End
  413.          Begin VB.TextBox LrText 
  414.             Height          =   300
  415.             Index           =   2
  416.             Left            =   1320
  417.             TabIndex        =   2
  418.             Text            =   "2"
  419.             Top             =   607
  420.             Width           =   1065
  421.          End
  422.          Begin VB.TextBox LrText 
  423.             Height          =   300
  424.             Index           =   0
  425.             Left            =   1320
  426.             TabIndex        =   0
  427.             Text            =   "0"
  428.             Top             =   240
  429.             Width           =   1365
  430.          End
  431.          Begin VB.TextBox LrText 
  432.             Height          =   300
  433.             Index           =   1
  434.             Left            =   3690
  435.             TabIndex        =   1
  436.             Text            =   "1"
  437.             Top             =   240
  438.             Width           =   615
  439.          End
  440.          Begin VB.Frame Frame2 
  441.             Caption         =   "审核状态"
  442.             Height          =   525
  443.             Left            =   150
  444.             TabIndex        =   18
  445.             Top             =   2580
  446.             Width           =   4155
  447.             Begin VB.OptionButton Opt_Check 
  448.                Caption         =   "全部"
  449.                Height          =   195
  450.                Index           =   0
  451.                Left            =   180
  452.                TabIndex        =   56
  453.                Top             =   210
  454.                Value           =   -1  'True
  455.                Width           =   855
  456.             End
  457.             Begin VB.OptionButton Opt_Check 
  458.                Caption         =   "未审核"
  459.                Height          =   195
  460.                Index           =   1
  461.                Left            =   1560
  462.                TabIndex        =   55
  463.                Top             =   210
  464.                Width           =   915
  465.             End
  466.             Begin VB.OptionButton Opt_Check 
  467.                Caption         =   "已审核"
  468.                Height          =   195
  469.                Index           =   2
  470.                Left            =   2760
  471.                TabIndex        =   54
  472.                Top             =   210
  473.                Width           =   1245
  474.             End
  475.          End
  476.          Begin VB.TextBox LrText 
  477.             Height          =   300
  478.             Index           =   3
  479.             Left            =   2880
  480.             TabIndex        =   3
  481.             Text            =   "3"
  482.             Top             =   607
  483.             Width           =   1125
  484.          End
  485.          Begin VB.TextBox LrText 
  486.             Height          =   300
  487.             Index           =   4
  488.             Left            =   1320
  489.             TabIndex        =   4
  490.             Text            =   "4"
  491.             Top             =   974
  492.             Width           =   2975
  493.          End
  494.          Begin VB.CommandButton Ydcommand1 
  495.             Height          =   300
  496.             Index           =   3
  497.             Left            =   4005
  498.             Picture         =   "采购系统_采购计划列表查询条件.frx":33DE
  499.             Style           =   1  'Graphical
  500.             TabIndex        =   17
  501.             Top             =   607
  502.             Visible         =   0   'False
  503.             Width           =   300
  504.          End
  505.          Begin VB.Line Line1 
  506.             X1              =   2730
  507.             X2              =   2850
  508.             Y1              =   750
  509.             Y2              =   750
  510.          End
  511.          Begin VB.Label Label1 
  512.             AutoSize        =   -1  'True
  513.             Caption         =   "物料编码:"
  514.             Height          =   180
  515.             Index           =   5
  516.             Left            =   150
  517.             TabIndex        =   25
  518.             Top             =   1770
  519.             Width           =   810
  520.          End
  521.          Begin VB.Label Label1 
  522.             AutoSize        =   -1  'True
  523.             Caption         =   "采购物料分类:"
  524.             Height          =   180
  525.             Index           =   4
  526.             Left            =   150
  527.             TabIndex        =   24
  528.             Top             =   1401
  529.             Width           =   1170
  530.          End
  531.          Begin VB.Label Label1 
  532.             AutoSize        =   -1  'True
  533.             Caption         =   "会计月份:"
  534.             Height          =   180
  535.             Index           =   3
  536.             Left            =   2760
  537.             TabIndex        =   23
  538.             Top             =   270
  539.             Width           =   810
  540.          End
  541.          Begin VB.Label Label1 
  542.             AutoSize        =   -1  'True
  543.             Caption         =   "计划日期:"
  544.             Height          =   180
  545.             Index           =   0
  546.             Left            =   150
  547.             TabIndex        =   21
  548.             Top             =   667
  549.             Width           =   810
  550.          End
  551.          Begin VB.Label Label1 
  552.             Caption         =   "会计年度:"
  553.             Height          =   255
  554.             Index           =   2
  555.             Left            =   150
  556.             TabIndex        =   20
  557.             Top             =   270
  558.             Width           =   915
  559.          End
  560.          Begin VB.Label Label1 
  561.             AutoSize        =   -1  'True
  562.             Caption         =   "计划单号:"
  563.             Height          =   180
  564.             Index           =   1
  565.             Left            =   150
  566.             TabIndex        =   19
  567.             Top             =   1034
  568.             Width           =   810
  569.          End
  570.       End
  571.    End
  572. End
  573. Attribute VB_Name = "Cg_PlanListQuery"
  574. Attribute VB_GlobalNameSpace = False
  575. Attribute VB_Creatable = False
  576. Attribute VB_PredeclaredId = True
  577. Attribute VB_Exposed = False
  578. '******************************************************************
  579. '*    模 块 名 称 :采购计划列表查询条件
  580. '*    功 能 描 述 :
  581. '*    程序员姓名  :李海祥
  582. '*    最后修改人  :李海祥
  583. '*    最后修改时间:2001/09/20
  584. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  585. '******************************************************************
  586. Dim Tsxx As String                       '系统信息提示
  587. '以下为固定使用变量(文本框)
  588. Dim Textvar() As Variant                 '存储变体型文本框信息
  589. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  590. Dim Textint() As Integer                 '存储整型文本框信息
  591. Dim Textstr() As String                  '存储字符型文本框信息
  592. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  593. Dim TextGroupCode As String              '文本框录入分组编码
  594. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  595. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  596. Dim CurTextIndex As Integer              '当前文本框索引值
  597. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  598. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  599. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  600.     Dim jdzygs As Integer                         '控件焦点转移个数
  601.     jdzygs = 30
  602.     Select Case KeyAscii
  603.         Case vbKeyReturn
  604.             If Kjjdzy(jdzygs) Then
  605.                 KeyAscii = 0
  606.             End If
  607.         Case 39           '屏蔽"'"
  608.             KeyAscii = 0
  609.     End Select
  610. End Sub
  611. Private Sub Form_Load()
  612.    
  613.     '以下为文本框处理程序(Fixed)
  614.     TextGroupCode = "Cg_PlanListQuery"
  615.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  616.     Call Wbkcsh
  617.     Call FillCombo(Cmb_PlanType, "Cg_PlanType", "01", 1)
  618.    
  619.     '[>>初始化查询条件默认值
  620.     LrText(0).Text = Year(Xtrq)
  621.     LrText(1).Text = Month(Xtrq)
  622.     Opt_Jjplan(0).Value = True
  623.     Opt_Exec(0).Value = True
  624.     
  625.     '<<]
  626.    
  627. End Sub
  628. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)          '查询条件窗体卸载
  629.     '查询条件窗体卸载时判断是否因为结果窗体卸载,如是则卸载,否则隐藏
  630.     If UnloadCheck.Value <> 1 Then
  631.         Cancel = 1
  632.         Me.Hide
  633.     End If
  634.     
  635. End Sub
  636. Private Sub QdCommand_Click()                                   '确 定
  637.     '录入条件有效性判断(Fixed)
  638.     If Not Lrtjyxxpd Then
  639.         Exit Sub
  640.     End If
  641.     Me.Hide
  642.         
  643.     '[>>激活查询过程结果窗体
  644.     
  645.     Cg_PlanList.Timer1.Enabled = True
  646.     Cg_PlanList.SetFocus
  647.     
  648.     '<<]
  649. End Sub
  650. Private Sub QxCommand_Click()                                    '取消(Fixed)
  651.     Me.Hide
  652. End Sub
  653. Private Function Lrtjyxxpd() As Boolean                          '用户录入条件有效性判断
  654.     Dim jsqte As Integer
  655.     Lrtjyxxpd = False
  656.  
  657.     '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
  658.     For jsqte = 0 To Max_Text_Index
  659.         If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  660.             If Not TextYxxpd(jsqte) Then
  661.                 Exit Function
  662.             End If
  663.         End If
  664.     Next jsqte
  665.    
  666.     '[>>以下为依据实际情况自定义部分
  667.  
  668.     '查询日期范围应由小到大
  669.     If LrText(2).Text > LrText(3).Text And Trim(LrText(3).Text) <> "" Then
  670.         Tsxx = "查询计划日期范围应由小到大!"
  671.         Call Xtxxts(Tsxx, 0, 4)
  672.         LrText(2).SetFocus
  673.         Exit Function
  674.     End If
  675.     '会计月份应在1到12之间
  676.     If Trim(LrText(1).Text) <> "" And (S2N(LrText(1).Text) > 12 Or S2N(LrText(1).Text) < 1) Then
  677.         Tsxx = "会计月份应该在1到12之间!"
  678.         Call Xtxxts(Tsxx, 0, 4)
  679.         LrText(1).SetFocus
  680.         Exit Function
  681.     End If
  682.     
  683.     '<<]以上为依据实际情况自定义部分
  684.  
  685.     Lrtjyxxpd = True
  686. End Function
  687. Private Sub Cmd_Clear_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)    '将用户输入条件全部清除(可选)
  688.     '清除文本框(Fixed)
  689.     For jsqte = 0 To Max_Text_Index
  690.         LrText(jsqte).Tag = ""
  691.         LrText(jsqte).Text = ""
  692.     Next jsqte
  693.     Opt_Jjplan(0).Value = True
  694.     Opt_Check(0).Value = True
  695.     Opt_Exec(0).Value = True
  696.     Opt_Close(0).Value = True
  697.     Cmb_PlanType.Text = Cmb_PlanType.List(0)
  698.     '[>>
  699.     '此处可以写入其他清除条件程序
  700.     '<<]
  701.   
  702. End Sub
  703. '*************以下为文本框录入处理程序(固定不变部分)*************'
  704. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  705.   
  706.     '以下为依据实际情况自定义部分[
  707.     '在此填写文本框录入事后处理程序
  708.     ']以上为依据实际情况自定义部分
  709.   
  710. End Sub
  711. Private Sub LrText_Change(Index As Integer)
  712.    
  713.     '屏蔽程序改变控制
  714.     If TextChangeLock Then
  715.         Exit Sub
  716.     End If
  717.     
  718.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  719.     
  720.     '限制字段录入长度
  721.           
  722.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  723.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  724.     Select Case Textint(Index, 1)
  725.         Case 8, 11      '金额型
  726.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  727.         Case 9, 12      '数量型
  728.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  729.         Case 10          '单价型
  730.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  731.         Case Else        '其他小数类型控制
  732.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  733.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  734.             End If
  735.     End Select
  736.         
  737.     TextChangeLock = False '解锁
  738. End Sub
  739. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  740.     Call TextShow(Index)
  741.     CurTextIndex = Index
  742.     LrText(Index).SelStart = Len(LrText(Index))
  743. End Sub
  744. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  745.     
  746.     Select Case KeyCode
  747.         Case vbKeyF2
  748.             Call Text_Help(Index)
  749.     End Select
  750. End Sub
  751. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  752.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  753. End Sub
  754. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  755.     '显示相应信息但不能进行有效性判断
  756.   
  757. End Sub
  758. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  759.     Call Text_Help(Index)
  760. End Sub
  761. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  762.     If Not Textboolean(Index, 1) Then
  763.         Exit Sub
  764.     End If
  765.      
  766.     '调用帮助
  767.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  768.   
  769.     '根据设置选择显示编码和名称,并进行存储
  770.     If Len(Xtfhcs) <> 0 Then
  771.         If Textint(Index, 3) = 1 Then
  772.             LrText(Index).Text = Xtfhcsfz
  773.             LrText(Index).Tag = Xtfhcs
  774.         Else
  775.             LrText(Index).Text = Xtfhcs
  776.             LrText(Index).Tag = Xtfhcsfz
  777.         End If
  778.     End If
  779.    
  780.     LrText(Index).SetFocus
  781. End Sub
  782. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  783.     '填写文本框得到焦点,进行相应信息处理程序
  784.    
  785. End Sub
  786. Private Sub Wbkcsh()                          '录入文本框初始化
  787.     
  788.     Dim jsqte As Integer
  789.   
  790.     '最大录入文本框索引值
  791.     Max_Text_Index = Textvar(1)
  792.   
  793.     ReDim TextValiJudgeLock(Max_Text_Index)
  794.     For jsqte = 0 To Max_Text_Index
  795.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  796.             If Textboolean(jsqte, 1) Then
  797.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  798.                     Load Ydcommand1(jsqte)
  799.                 End If
  800.                 Ydcommand1(jsqte).Visible = True
  801.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  802.             End If
  803.             TextChangeLock = True
  804.             LrText(jsqte).Text = ""
  805.             LrText(jsqte).Tag = ""
  806.             If Textint(jsqte, 5) <> 0 Then
  807.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  808.             End If
  809.             TextChangeLock = False
  810.         End If
  811.         TextValiJudgeLock(jsqte) = True
  812.     Next jsqte
  813. End Sub
  814. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  815.     
  816.     Dim Sqlstr As String
  817.     Dim Findrec As ADODB.Recordset
  818.   
  819.     '文本框内容未曾改变不进行有效性判断
  820.     If TextValiJudgeLock(Index) Then
  821.         TextYxxpd = True
  822.         Exit Function
  823.     End If
  824.   
  825.     '文本框内容为空认为有效,并清空其Tag值
  826.     If Trim(LrText(Index)) = "" Then
  827.         LrText(Index).Tag = ""
  828.         Call Wbklrwbcl(Index)
  829.         TextValiJudgeLock(Index) = True
  830.         TextYxxpd = True
  831.         Exit Function
  832.     End If
  833.   
  834.     '可在此加入不做有效性判断的理由
  835.   
  836.     Select Case Textint(Index, 4)
  837.         Case 1      '编码型
  838.             Sqlstr = Trim(Textstr(Index, 5))
  839.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  840.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  841.             If Findrec.EOF Then
  842.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  843.                 LrText(Index).SetFocus
  844.                 Exit Function
  845.             Else
  846.                 Select Case Textint(Index, 3)
  847.                     Case 0
  848.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  849.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  850.                         End If
  851.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  852.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  853.                         End If
  854.                     Case 1
  855.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  856.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  857.                         End If
  858.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  859.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  860.                         End If
  861.                 End Select
  862.             End If
  863.         Case 2      '日期型
  864.             If IsDate(LrText(Index).Text) Then
  865.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  866.                 If S2N(Mid(LrText(Index), 1, 4)) < 1900 Then
  867.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  868.                 End If
  869.             Else
  870.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  871.                 Call Xtxxts(Tsxx, 0, 1)
  872.                 LrText(Index).SetFocus
  873.                 Exit Function
  874.             End If
  875.         Case 3      '其他类型
  876.     End Select
  877.     
  878.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  879.     TextValiJudgeLock(Index) = True
  880.     '调用文本框事后处理程序
  881.     Call Wbklrwbcl(Index)
  882.    
  883.     '有效性判断通过则返回True
  884.     TextYxxpd = True
  885.    
  886. End Function