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