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

企业管理

开发平台:

Visual Basic

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