-
Notifications
You must be signed in to change notification settings - Fork 0
/
INN.vb
67 lines (45 loc) · 1.18 KB
/
INN.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Dim totQty
totQty = me.Symbols.Count
if totQty = 0 then
Exit Sub
end if
for i = totQty - 1 to 0 Step -1
if instr( 1, "0123456789/\|", me.Symbols(i).Symbol ) = 0 then
me.Symbols.Delete(i)
End if
next
'======================================================================================
Dim vFieldName, vFieldVal, i
Dim IssKPP, IssINN
vFieldName = "IssINNKPP"
vFieldVal = me.Field(vFieldName).Text
if Len(vFieldVal) < 10 then
me.Field(vFieldName).Text = ""
Exit Sub
end if
i = 0
for i = Len(vFieldVal) - 1 to 2 Step -1
if instr( 1, "/\|", Mid( vFieldVal, i , 1 ) ) <> 0 then
Exit for
End if
next
if i > 1 then
IssKPP = Right (vFieldVal, Len(vFieldVal) - i)
IssINN = Left (vFieldVal, i - 1)
else
IssINN = vFieldVal
end if
if Len(IssINN) > 12 then
IssINN = Left(IssINN, 12)
end if
if Len(IssINN) < 10 then
IssINN = ""
end if
if Len(IssKPP) > 9 then
IssKPP = Left(IssKPP, 9)
end if
if Len(IssKPP) < 9 then
IssKPP = ""
end if
me.Field("IssINN").Text = IssINN
me.Field("IssKPP").Text = IssKPP