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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form KF_FrmProductInQuery 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "产成品入库单列表查询条件"
  6.    ClientHeight    =   4395
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5190
  10.    Icon            =   "入库_产成品入库单查询条件.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4395
  16.    ScaleWidth      =   5190
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   1  '所有者中心
  19.    Begin TabDlg.SSTab SSTab1 
  20.       Height          =   3855
  21.       Left            =   60
  22.       TabIndex        =   18
  23.       Top             =   90
  24.       Width           =   5055
  25.       _ExtentX        =   8916
  26.       _ExtentY        =   6800
  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          =   3435
  45.          Left            =   105
  46.          TabIndex        =   24
  47.          Top             =   330
  48.          Width           =   4860
  49.          Begin VB.CommandButton Ydcommand1 
  50.             Height          =   300
  51.             Index           =   4
  52.             Left            =   4440
  53.             Picture         =   "入库_产成品入库单查询条件.frx":107A
  54.             Style           =   1  'Graphical
  55.             TabIndex        =   27
  56.             Top             =   960
  57.             Visible         =   0   'False
  58.             Width           =   300
  59.          End
  60.          Begin VB.Frame Frame2 
  61.             Caption         =   "审核状态"
  62.             Height          =   525
  63.             Left            =   150
  64.             TabIndex        =   39
  65.             Top             =   2820
  66.             Width           =   4590
  67.             Begin VB.OptionButton OptCheck 
  68.                Caption         =   "已审核"
  69.                Height          =   300
  70.                Index           =   2
  71.                Left            =   3240
  72.                TabIndex        =   42
  73.                Top             =   180
  74.                Width           =   885
  75.             End
  76.             Begin VB.OptionButton OptCheck 
  77.                Caption         =   "未审核"
  78.                Height          =   300
  79.                Index           =   1
  80.                Left            =   1717
  81.                TabIndex        =   41
  82.                Top             =   180
  83.                Width           =   900
  84.             End
  85.             Begin VB.OptionButton OptCheck 
  86.                Caption         =   "全部"
  87.                Height          =   300
  88.                Index           =   0
  89.                Left            =   270
  90.                TabIndex        =   40
  91.                Top             =   180
  92.                Value           =   -1  'True
  93.                Width           =   825
  94.             End
  95.          End
  96.          Begin VB.CommandButton Ydcommand1 
  97.             Height          =   300
  98.             Index           =   8
  99.             Left            =   4440
  100.             Picture         =   "入库_产成品入库单查询条件.frx":1404
  101.             Style           =   1  'Graphical
  102.             TabIndex        =   38
  103.             Top             =   2475
  104.             Visible         =   0   'False
  105.             Width           =   300
  106.          End
  107.          Begin VB.TextBox LrText 
  108.             BackColor       =   &H00FFFFFF&
  109.             Height          =   300
  110.             Index           =   8
  111.             Left            =   990
  112.             TabIndex        =   8
  113.             Text            =   "8"
  114.             Top             =   2475
  115.             Width           =   3465
  116.          End
  117.          Begin VB.CommandButton Ydcommand1 
  118.             Height          =   300
  119.             Index           =   7
  120.             Left            =   4440
  121.             Picture         =   "入库_产成品入库单查询条件.frx":178E
  122.             Style           =   1  'Graphical
  123.             TabIndex        =   37
  124.             Top             =   2100
  125.             Visible         =   0   'False
  126.             Width           =   300
  127.          End
  128.          Begin VB.CommandButton Ydcommand1 
  129.             Height          =   300
  130.             Index           =   1
  131.             Left            =   4440
  132.             Picture         =   "入库_产成品入库单查询条件.frx":1B18
  133.             Style           =   1  'Graphical
  134.             TabIndex        =   36
  135.             Top             =   210
  136.             Visible         =   0   'False
  137.             Width           =   300
  138.          End
  139.          Begin VB.TextBox LrText 
  140.             Height          =   300
  141.             Index           =   2
  142.             Left            =   990
  143.             TabIndex        =   2
  144.             Text            =   "2"
  145.             Top             =   585
  146.             Width           =   1650
  147.          End
  148.          Begin VB.TextBox LrText 
  149.             Height          =   300
  150.             Index           =   3
  151.             Left            =   3090
  152.             TabIndex        =   3
  153.             Text            =   "3"
  154.             Top             =   585
  155.             Width           =   1650
  156.          End
  157.          Begin VB.TextBox LrText 
  158.             Height          =   300
  159.             Index           =   0
  160.             Left            =   990
  161.             TabIndex        =   0
  162.             Text            =   "0"
  163.             Top             =   210
  164.             Width           =   1365
  165.          End
  166.          Begin VB.TextBox LrText 
  167.             Height          =   300
  168.             Index           =   4
  169.             Left            =   990
  170.             TabIndex        =   4
  171.             Text            =   "4"
  172.             Top             =   960
  173.             Width           =   3465
  174.          End
  175.          Begin VB.CommandButton Ydcommand1 
  176.             Height          =   300
  177.             Index           =   0
  178.             Left            =   2340
  179.             Picture         =   "入库_产成品入库单查询条件.frx":1EA2
  180.             Style           =   1  'Graphical
  181.             TabIndex        =   28
  182.             Top             =   210
  183.             Visible         =   0   'False
  184.             Width           =   300
  185.          End
  186.          Begin VB.CommandButton Ydcommand1 
  187.             Height          =   300
  188.             Index           =   5
  189.             Left            =   4440
  190.             Picture         =   "入库_产成品入库单查询条件.frx":222C
  191.             Style           =   1  'Graphical
  192.             TabIndex        =   26
  193.             Top             =   1350
  194.             Visible         =   0   'False
  195.             Width           =   300
  196.          End
  197.          Begin VB.TextBox LrText 
  198.             Height          =   300
  199.             Index           =   5
  200.             Left            =   990
  201.             TabIndex        =   5
  202.             Text            =   "5"
  203.             Top             =   1350
  204.             Width           =   3465
  205.          End
  206.          Begin VB.TextBox LrText 
  207.             Height          =   300
  208.             Index           =   6
  209.             Left            =   990
  210.             TabIndex        =   6
  211.             Text            =   "6"
  212.             Top             =   1725
  213.             Width           =   3465
  214.          End
  215.          Begin VB.TextBox LrText 
  216.             BackColor       =   &H00FFFFFF&
  217.             Height          =   300
  218.             Index           =   7
  219.             Left            =   990
  220.             TabIndex        =   7
  221.             Text            =   "7"
  222.             Top             =   2100
  223.             Width           =   3465
  224.          End
  225.          Begin VB.CommandButton Ydcommand1 
  226.             Height          =   300
  227.             Index           =   6
  228.             Left            =   4440
  229.             Picture         =   "入库_产成品入库单查询条件.frx":25B6
  230.             Style           =   1  'Graphical
  231.             TabIndex        =   25
  232.             Top             =   1725
  233.             Visible         =   0   'False
  234.             Width           =   300
  235.          End
  236.          Begin VB.TextBox LrText 
  237.             Height          =   300
  238.             Index           =   1
  239.             Left            =   3090
  240.             TabIndex        =   1
  241.             Text            =   "1"
  242.             Top             =   210
  243.             Width           =   1365
  244.          End
  245.          Begin VB.Line Line1 
  246.             Index           =   1
  247.             X1              =   2760
  248.             X2              =   2970
  249.             Y1              =   360
  250.             Y2              =   360
  251.          End
  252.          Begin VB.Line Line1 
  253.             Index           =   0
  254.             X1              =   2760
  255.             X2              =   2940
  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            =   150
  266.             TabIndex        =   35
  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            =   150
  277.             TabIndex        =   34
  278.             Top             =   1020
  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            =   150
  288.             TabIndex        =   33
  289.             Top             =   2160
  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            =   150
  299.             TabIndex        =   32
  300.             Top             =   2535
  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            =   150
  310.             TabIndex        =   31
  311.             Top             =   1785
  312.             Width           =   810
  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            =   150
  321.             TabIndex        =   30
  322.             Top             =   1410
  323.             Width           =   450
  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            =   150
  332.             TabIndex        =   29
  333.             Top             =   270
  334.             Width           =   810
  335.          End
  336.       End
  337.       Begin VB.Frame Frame3 
  338.          Height          =   3435
  339.          Left            =   -74895
  340.          TabIndex        =   19
  341.          Top             =   330
  342.          Width           =   4860
  343.          Begin VB.TextBox LrText 
  344.             Height          =   300
  345.             Index           =   11
  346.             Left            =   705
  347.             TabIndex        =   11
  348.             Text            =   "11"
  349.             Top             =   600
  350.             Width           =   1770
  351.          End
  352.          Begin VB.TextBox LrText 
  353.             Height          =   300
  354.             Index           =   12
  355.             Left            =   2955
  356.             TabIndex        =   12
  357.             Text            =   "12"
  358.             Top             =   600
  359.             Width           =   1770
  360.          End
  361.          Begin VB.TextBox LrText 
  362.             Height          =   300
  363.             Index           =   9
  364.             Left            =   705
  365.             TabIndex        =   9
  366.             Text            =   "9"
  367.             Top             =   210
  368.             Width           =   1770
  369.          End
  370.          Begin VB.TextBox LrText 
  371.             Height          =   300
  372.             Index           =   10
  373.             Left            =   2955
  374.             TabIndex        =   10
  375.             Text            =   "10"
  376.             Top             =   210
  377.             Width           =   1770
  378.          End
  379.          Begin VB.TextBox LrText 
  380.             Height          =   300
  381.             Index           =   13
  382.             Left            =   705
  383.             TabIndex        =   13
  384.             Text            =   "13"
  385.             Top             =   975
  386.             Width           =   3720
  387.          End
  388.          Begin VB.CommandButton Ydcommand1 
  389.             Height          =   300
  390.             Index           =   13
  391.             Left            =   4425
  392.             Picture         =   "入库_产成品入库单查询条件.frx":2940
  393.             Style           =   1  'Graphical
  394.             TabIndex        =   20
  395.             Top             =   975
  396.             Visible         =   0   'False
  397.             Width           =   300
  398.          End
  399.          Begin VB.Label Label1 
  400.             AutoSize        =   -1  'True
  401.             Caption         =   "数量:"
  402.             Height          =   180
  403.             Index           =   7
  404.             Left            =   165
  405.             TabIndex        =   23
  406.             Top             =   660
  407.             Width           =   450
  408.          End
  409.          Begin VB.Label Label1 
  410.             AutoSize        =   -1  'True
  411.             Caption         =   "金额:"
  412.             Height          =   180
  413.             Index           =   6
  414.             Left            =   165
  415.             TabIndex        =   22
  416.             Top             =   270
  417.             Width           =   450
  418.          End
  419.          Begin VB.Line Line2 
  420.             Index           =   0
  421.             X1              =   2610
  422.             X2              =   2850
  423.             Y1              =   360
  424.             Y2              =   360
  425.          End
  426.          Begin VB.Line Line2 
  427.             Index           =   1
  428.             X1              =   2580
  429.             X2              =   2820
  430.             Y1              =   750
  431.             Y2              =   750
  432.          End
  433.          Begin VB.Label Label1 
  434.             AutoSize        =   -1  'True
  435.             Caption         =   "货区:"
  436.             Height          =   180
  437.             Index           =   4
  438.             Left            =   165
  439.             TabIndex        =   21
  440.             Top             =   1035
  441.             Width           =   450
  442.          End
  443.       End
  444.    End
  445.    Begin VB.CommandButton Cmd_Clear 
  446.       Caption         =   "全清"
  447.       Height          =   300
  448.       Left            =   90
  449.       TabIndex        =   15
  450.       Top             =   4020
  451.       Width           =   1120
  452.    End
  453.    Begin VB.CommandButton QxCommand 
  454.       Caption         =   "取消(&C)"
  455.       Height          =   300
  456.       Left            =   3990
  457.       TabIndex        =   16
  458.       Top             =   4020
  459.       Width           =   1120
  460.    End
  461.    Begin VB.CommandButton QdCommand 
  462.       Caption         =   "确定(&O)"
  463.       Height          =   300
  464.       Left            =   2790
  465.       TabIndex        =   14
  466.       Top             =   4020
  467.       Width           =   1120
  468.    End
  469.    Begin VB.CheckBox UnloadCheck 
  470.       Caption         =   "卸载窗体"
  471.       Height          =   615
  472.       Left            =   5850
  473.       TabIndex        =   17
  474.       Top             =   1260
  475.       Width           =   825
  476.    End
  477. End
  478. Attribute VB_Name = "KF_FrmProductInQuery"
  479. Attribute VB_GlobalNameSpace = False
  480. Attribute VB_Creatable = False
  481. Attribute VB_PredeclaredId = True
  482. Attribute VB_Exposed = False
  483. '******************************************************************
  484. '*    模 块 名 称 :产成品入库单列表查询条件
  485. '*    功 能 描 述 :
  486. '*    程序员姓名  :赵宇光
  487. '*    最后修改人  :赵宇光
  488. '*    最后修改时间:2001/11/29
  489. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  490. '******************************************************************
  491. Dim Tsxx As String                       '系统信息提示
  492. '以下为固定使用变量(文本框)
  493. Dim Textvar() As Variant                 '存储变体型文本框信息
  494. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  495. Dim Textint() As Integer                 '存储整型文本框信息
  496. Dim Textstr() As String                  '存储字符型文本框信息
  497. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  498. Dim TextGroupCode As String              '文本框录入分组编码
  499. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  500. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  501. Dim CurTextIndex As Integer              '当前文本框索引值
  502. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  503. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  504. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  505.     Dim jdzygs As Integer                         '控件焦点转移个数
  506.     jdzygs = 30
  507.     Select Case KeyAscii
  508.         Case vbKeyReturn
  509.             If Kjjdzy(jdzygs) Then
  510.                 KeyAscii = 0
  511.             End If
  512.         Case 39           '屏蔽"'"
  513.             KeyAscii = 0
  514.     End Select
  515. End Sub
  516. Private Sub Form_Load()
  517.    
  518.     '以下为文本框处理程序(Fixed)
  519.     TextGroupCode = "KF_ProductInQuery"
  520.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  521.     Call Wbkcsh
  522.     
  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_FrmProductInList.Timer1.Enabled = True
  545.     KF_FrmProductInList.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(4).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