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

企业管理

开发平台:

Visual Basic

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