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

企业管理

开发平台:

Visual Basic

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