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.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
985.
986.
987.
988.
989.
990.
991.
992.
993.
994.
995.
996.
997.
998.
999.
1000.
1001.
1002.
1003.
1004.
1005.
1006.
1007.
1008.
1009.
1010.
1011.
1012.
1013.
1014.
1015.
1016.
1017.
1018.
1019.
1020.
1021.
1022.
1023.
1024.
1025.
1026.
1027.
1028.
1029.
1030.
1031.
1032.
1033.
1034.
1035.
1036.
1037.
1038.
1039.
1040.
1041.
1042.
1043.
1044.
1045.
1046.
1047.
1048.
1049.
1050.
1051.
1052.
1053.
1054.
1055.
1056.
1057.
1058.
1059.
1060.
1061.
1062.
1063.
1064.
1065.
1066.
1067.
1068.
1069.
1070.
1071.
1072.
1073.
1074.
1075.
1076.
1077.
1078.
1079.
1080.
1081.
1082.
1083.
1084.
1085.
1086.
1087.
1088.
1089.
1090.
1091.
1092.
1093.
1094.
1095.
1096.
1097.
1098.
1099.
1100.
1101.
1102.
1103.
1104.
1105.
1106.
1107.
1108.
1109.
1110.
1111.
1112.
1113.
1114.
1115.
1116.
1117.
1118.
1119.
1120.
1121.
1122.
1123.
1124.
1125.
1126.
1127.
1128.
1129.
1130.
1131.
1132.
1133.
1134.
1135.
1136.
1137.
1138.
1139.
1140.
1141.
1142.
1143.
1144.
1145.
1146.
1147.
1148.
1149.
1150.
1151.
1152.
1153.
1154.
1155.
1156.
1157.
1158.
1159.
1160.
1161.
1162.
1163.
1164.
1165.
1166.
1167.
1168.
1169.
1170.
1171.
1172.
1173.
1174.
1175.
1176.
1177.
1178.
1179.
1180.
1181.
1182.
1183.
1184.
1185.
1186.
1187.
1188.
1189.
1190.
1191.
1192.
1193.
1194.
1195.
1196.
1197.
1198.
1199.
1200.
1201.
1202.
1203.
1204.
1205.
1206.
1207.
1208.
1209.
1210.
1211.
1212.
1213.
1214.
1215.
1216.
1217.
1218.
1219.
1220.
1221.
1222.
1223.
1224.
1225.
1226.
1227.
1228.
1229.
1230.
1231.
1232.
1233.
1234.
1235.
1236.
1237.
1238.
1239.
1240.
1241.
1242.
1243.
1244.
1245.
1246.
1247.
1248.
1249.
1250.
1251.
1252.
1253.
1254.
1255.
1256.
1257.
1258.
1259.
1260.
1261.
1262.
1263.
1264.
1265.
1266.
1267.
1268.
1269.
1270.
1271.
1272.
1273.
1274.
1275.
1276.
1277.
1278.
1279.
1280.
1281.
1282.
1283.
1284.
1285.
1286.
1287.
1288.
1289.
1290.
1291.
1292.
1293.
1294.
1295.
1296.
1297.
1298.
1299.
1300.
1301.
1302.
1303.
1304.
1305.
1306.
1307.
1308.
1309.
1310.
1311.
1312.
1313.
1314.
1315.
1316.
1317.
1318.
1319.
1320.
1321.
1322.
1323.
1324.
1325.
1326.
1327.
1328.
1329.
1330.
1331.
1332.
1333.
1334.
1335.
1336.
1337.
1338.
1339.
1340.
1341.
1342.
1343.
1344.
1345.
1346.
1347.
1348.
1349.
1350.
1351.
1352.
1353.
1354.
1355.
1356.
1357.
1358.
1359.
1360.
1361.
1362.
1363.
1364.
1365.
1366.
1367.
1368.
1369.
1370.
1371.
1372.
1373.
1374.
1375.
1376.
1377.
1378.
1379.
1380.
1381.
1382.
1383.
1384.
1385.
1386.
1387.
1388.
1389.
1390.
1391.
1392.
1393.
1394.
1395.
1396.
1397.
1398.
1399.
1400.
1401.
1402.
1403.
1404.
1405.
1406.
1407.
1408.
1409.
1410.
1411.
1412.
1413.
1414.
1415.
1416.
1417.
1418.
1419.
1420.
1421.
1422.
1423.
1424.
1425.
1426.
1427.
1428.
1429.
1430.
1431.
1432.
1433.
1434.
1435.
1436.
1437.
1438.
1439.
1440.
1441.
1442.
1443.
1444.
1445.
1446.
1447.
1448.
1449.
1450.
1451.
1452.
1453.
1454.
1455.
1456.
1457.
1458.
1459.
1460.
1461.
1462.
1463.
1464.
1465.
1466.
1467.
1468.
1469.
1470.
1471.
1472.
1473.
1474.
1475.
1476.
1477.
1478.
1479.
1480.
1481.
1482.
1483.
1484.
1485.
1486.
1487.
1488.
1489.
1490.
1491.
1492.
1493.
1494.
1495.
1496.
1497.
1498.
1499.
1500.
1501.
1502.
1503.
1504.
1505.
1506.
1507.
1508.
1509.
1510.
1511.
1512.
1513.
1514.
1515.
1516.
1517.
1518.
1519.
1520.
1521.
1522.
1523.
1524.
1525.
1526.
1527.
1528.
1529.
1530.
1531.
1532.
1533.
1534.
1535.
1536.
1537.
1538.
1539.
1540.
1541.
1542.
1543.
1544.
1545.
1546.
1547.
1548.
1549.
1550.
1551.
1552.
1553.
1554.
1555.
1556.
1557.
1558.
1559.
1560.
1561.
1562.
1563.
1564.
1565.
1566.
1567.
1568.
1569.
1570.
1571.
1572.
1573.
1574.
1575.
1576.
1577.
1578.
1579.
1580.
1581.
1582.
1583.
1584.
1585.
1586.
1587.
1588.
1589.
1590.
1591.
1592.
1593.
1594.
1595.
1596.
1597.
1598.
1599.
1600.
1601.
1602.
1603.
1604.
1605.
1606.
1607.
1608.
1609.
1610.
1611.
1612.
1613.
1614.
1615.
1616.
1617.
1618.
1619.
1620.
1621.
1622.
1623.
1624.
1625.
1626.
1627.
1628.
1629.
1630.
1631.
1632.
1633.
1634.
1635.
1636.
1637.
1638.
1639.
1640.
1641.
1642.
1643.
1644.
1645.
1646.
1647.
1648.
1649.
1650.
1651.
1652.
1653.
1654.
1655.
1656.
1657.
1658.
1659.
1660.
1661.
1662.
1663.
1664.
1665.
1666.
1667.
1668.
1669.
1670.
1671.
1672.
1673.
1674.
1675.
1676.
1677.
1678.
1679.
1680.
1681.
1682.
1683.
1684.
1685.
1686.
1687.
1688.
1689.
1690.
1691.
1692.
1693.
1694.
1695.
1696.
1697.
1698.
1699.
1700.
1701.
1702.
1703.
1704.
1705.
1706.
1707.
1708.
1709.
1710.
1711.
1712.
1713.
1714.
1715.
1716.
1717.
1718.
1719.
1720.
1721.
1722.
1723.
1724.
1725.
1726.
1727.
1728.
1729.
1730.
1731.
1732.
1733.
1734.
1735.
1736.
1737.
1738.
1739.
1740.
1741.
1742.
1743.
1744.
1745.
1746.
1747.
1748.
1749.
1750.
1751.
1752.
1753.
1754.
1755.
1756.
1757.
1758.
1759.
1760.
1761.
1762.
1763.
1764.
1765.
1766.
1767.
1768.
1769.
1770.
1771.
1772.
1773.
1774.
1775.
1776.
1777.
1778.
1779.
1780.
1781.
1782.
1783.
1784.
1785.
1786.
1787.
1788.
1789.
1790.
1791.
1792.
1793.
1794.
1795.
1796.
1797.
1798.
1799.
1800.
1801.
1802.
1803.
1804.
1805.
1806.
1807.
1808.
1809.
1810.
1811.
1812.
1813.
1814.
1815.
1816.
1817.
1818.
1819.
1820.
1821.
1822.
1823.
1824.
1825.
1826.
1827.
1828.
1829.
1830.
1831.
1832.
1833.
1834.
1835.
1836.
1837.
1838.
1839.
1840.
1841.
1842.
1843.
1844.
1845.
1846.
1847.
1848.
1849.
1850.
1851.
1852.
1853.
1854.
1855.
1856.
1857.
1858.
1859.
1860.
1861.
1862.
1863.
1864.
1865.
1866.
1867.
1868.
1869.
1870.
1871.
1872.
1873.
1874.
1875.
1876.
1877.
1878.
1879.
1880.
1881.
1882.
1883.
1884.
1885.
1886.
1887.
1888.
1889.
1890.
1891.
1892.
1893.
1894.
1895.
1896.
1897.
1898.
1899.
1900.
1901.
1902.
1903.
1904.
1905.
1906.
1907.
1908.
1909.
1910.
1911.
1912.
1913.
1914.
1915.
1916.
1917.
1918.
1919.
1920.
1921.
1922.
1923.
1924.
1925.
1926.
1927.
1928.
1929.
1930.
1931.
1932.
1933.
1934.
1935.
1936.
1937.
1938.
1939.
1940.
1941.
1942.
1943.
1944.
1945.
1946.
1947.
1948.
1949.
1950.
1951.
1952.
1953.
1954.
1955.
1956.
1957.
1958.
1959.
1960.
1961.
1962.
1963.
1964.
1965.
1966.
1967.
1968.
1969.
1970.
1971.
1972.
1973.
1974.
1975.
1976.
1977.
1978.
1979.
1980.
1981.
1982.
1983.
1984.
1985.
1986.
1987.
1988.
1989.
1990.
1991.
1992.
1993.
1994.
1995.
1996.
1997.
1998.
1999.
2000.
2001.
2002.
2003.
2004.
2005.
2006.
2007.
2008.
2009.
2010.
2011.
2012.
2013.
2014.
2015.
2016.
2017.
2018.
2019.
2020.
2021.
2022.
2023.
2024.
2025.
2026.
2027.
2028.
2029.
2030.
2031.
2032.
2033.
2034.
2035.
2036.
2037.
2038.
2039.
2040.
2041.
2042.
2043.
2044.
2045.
2046.
2047.
2048.
2049.
2050.
2051.
2052.
2053.
2054.
2055.
2056.
2057.
2058.
2059.
2060.
2061.
2062.
2063.
2064.
2065.
2066.
2067.
2068.
2069.
2070.
2071.
2072.
2073.
2074.
2075.
2076.
2077.
2078.
2079.
2080.
2081.
2082.
2083.
2084.
2085.
2086.
2087.
2088.
2089.
2090.
2091.
2092.
2093.
2094.
2095.
2096.
2097.
2098.
2099.
2100.
2101.
2102.
2103.
2104.
2105.
2106.
2107.
2108.
2109.
2110.
2111.
2112.
2113.
2114.
2115.
2116.
2117.
2118.
2119.
2120.
2121.
2122.
2123.
2124.
2125.
2126.
2127.
2128.
2129.
2130.
2131.
2132.
2133.
2134.
2135.
2136.
2137.
2138.
2139.
2140.
2141.
2142.
2143.
2144.
2145.
2146.
2147.
2148.
2149.
2150.
2151.
2152.
2153.
2154.
2155.
2156.
2157.
2158.
2159.
2160.
2161.
2162.
2163.
2164.
2165.
2166.
2167.
2168.
2169.
2170.
2171.
2172.
2173.
2174.
2175.
2176.
2177.
2178.
2179.
2180.
2181.
2182.
2183.
2184.
2185.
2186.
2187.
2188.
2189.
2190.
2191.
2192.
2193.
2194.
2195.
2196.
2197.
2198.
2199.
2200.
2201.
2202.
2203.
2204.
2205.
2206.
2207.
2208.
2209.
2210.
2211.
2212.
2213.
2214.
2215.
2216.
2217.
2218.
2219.
2220.
2221.
2222.
2223.
2224.
2225.
2226.
2227.
2228.
2229.
2230.
2231.
2232.
2233.
2234.
2235.
2236.
2237.
2238.
2239.
2240.
2241.
2242.
2243.
2244.
2245.
2246.
2247.
2248.
2249.
2250.
2251.
2252.
2253.
2254.
2255.
2256.
2257.
2258.
2259.
2260.
2261.
2262.
2263.
2264.
2265.
2266.
2267.
2268.
2269.
2270.
2271.
2272.
2273.
2274.
2275.
2276.
2277.
2278.
2279.
2280.
2281.
2282.
2283.
2284.
2285.
2286.
2287.
2288.
2289.
2290.
2291.
2292.
2293.
2294.
2295.
2296.
2297.
2298.
2299.
2300.
2301.
2302.
2303.
2304.
2305.
2306.
2307.
2308.
2309.
2310.
2311.
2312.
2313.
2314.
2315.
2316.
2317.
2318.
2319.
2320.
2321.
2322.
2323.
2324.
2325.
2326.
2327.
2328.
2329.
2330.
2331.
2332.
2333.
2334.
2335.
2336.
2337.
2338.
2339.
2340.
2341.
2342.
2343.
2344.
2345.
2346.
2347.
2348.
2349.
2350.
2351.
2352.
2353.
2354.
2355.
2356.
2357.
2358.
2359.
2360.
2361.
2362.
2363.
2364.
2365.
2366.
2367.
2368.
2369.
2370.
2371.
2372.
2373.
2374.
2375.
2376.
2377.
2378.
2379.
2380.
2381.
2382.
2383.
2384.
2385.
2386.
2387.
2388.
2389.
2390.
2391.
2392.
2393.
2394.
2395.
2396.
2397.
2398.
2399.
2400.
2401.
2402.
2403.
2404.
2405.
2406.
2407.
2408.
2409.
2410.
2411.
2412.
2413.
2414.
2415.
2416.
2417.
2418.
2419.
2420.
2421.
2422.
2423.
2424.
2425.
2426.
2427.
2428.
2429.
2430.
2431.
2432.
2433.
2434.
2435.
2436.
2437.
2438.
2439.
2440.
2441.
2442.
2443.
2444.
2445.
2446.
2447.
2448.
2449.
2450.
2451.
2452.
2453.
2454.
2455.
2456.
2457.
2458.
2459.
2460.
2461.
2462.
2463.
2464.
2465.
2466.
2467.
2468.
2469.
2470.
2471.
2472.
2473.
2474.
2475.
2476.
2477.
2478.
2479.
2480.
2481.
2482.
2483.
2484.
2485.
2486.
2487.
2488.
2489.
2490.
2491.
2492.
2493.
2494.
2495.
2496.
2497.
2498.
2499.
2500.
2501.
2502.
2503.
2504.
2505.
2506.
2507.
2508.
2509.
2510.
2511.
2512.
2513.
2514.
2515.
2516.
2517.
2518.
2519.
2520.
2521.
2522.
2523.
2524.
2525.
2526.
2527.
2528.
2529.
2530.
2531.
2532.
2533.
2534.
2535.
2536.
2537.
2538.
2539.
2540.
2541.
Option Compare Database
Option Explicit
'============================================================================
' Тяжелая форма-карточка, вложенная в форму-эксплорер like
'============================================================================
Public WithEvents PersonGrid As Form
Public WithEvents CustomerChildGrid As Form
Public WithEvents InvestmentGrid As Form
Public WithEvents AccountGrid As Form
Public WithEvents RaitingGrid As Form
Public WithEvents CustomerHistoryGrid As Form
Public WithEvents CustomerSourceGrid As Form
Dim rsFind As ADODB.Recordset
Public bQueryUpdate As Boolean
Dim bLoading As Boolean
Public iTabIndex As Integer
Private Sub Form_Current()
If bLoading Then Exit Sub
Me.Painting = False
On Error Resume Next
Me!sTop.ForeColor = 16711680 ' синий
Me!lblTop.ForeColor = 16711680 ' синий
bQueryUpdate = True
Dim s: s = Me.ActiveControl.Name
Me!btnTransparent.SetFocus
modCustomer.SetupCustomerForm Me
Me.Controls(s).SetFocus
On Error GoTo 0
On Error Resume Next
If Me.Recordset.EOF And Me.Recordset.BOF Or Me.NewRecord Then
Me.Parent.lblSub.Visible = True
Me.Parent.Controls("subCustomer").Visible = False
Else
Me.Parent.lblSub.Visible = False
Me.Parent.Controls("subCustomer").Visible = True
End If
On Error GoTo 0
Me.Painting = True
End Sub
Private Sub Form_AfterInsert()
modCustomer.HandleAfterInsert Me
Call Form_Current
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If bQueryUpdate Then Call modMessage.QueryUpdate(Cancel)
modCustomer.CheckOGRN Me, Cancel
modCustomer.CheckINN Me, Cancel
modCustomer.CheckBIK Me, Cancel
If Cancel Then Exit Sub
If Me.NewRecord Then Exit Sub
Dim bSaveHistory As Boolean: bSaveHistory = False
modCustomer.CheckSaveHistory Me, bSaveHistory
If Not bSaveHistory Then Exit Sub
modCustomer.SaveHistory Me
End Sub
Private Sub Form_AfterUpdate()
Me.Painting = False
Call modCustomer.SetupCustomerForm(Me)
Me.Painting = True
End Sub
Private Sub Form_Load()
On Error GoTo err_label
bLoading = True
Me.TimerInterval = 100 : Me.OnTimer = "[Event Procedure]"
exit_label:
Exit Sub
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Sub
Private Sub Form_Resize()
Dim s: s = ""
On Error Resume Next
s = Me.Parent.Name
On Error GoTo 0
If Len(s) = 0 Then
ResizeSubForm Me.InsideHeight, Me.InsideWidth
End If
End Sub
Private Sub Form_Timer()
On Error GoTo err_label
bLoading = True
iTabIndex = 0
Me.TimerInterval = 0 : Me.OnTimer = ""
Me.Repaint: Me.Painting = False
DoCmd.Hourglass True
modSYS.SetList Me!lstSort_Person, "PersonPositionOrderBy"
modSYS.SetList Me!lstFilter_Person, "PersonPositionGEFilter"
modSYS.SetList Me!iCustomerParentID, "CustomerList"
modSYS.SetList Me!lstSort_InqueryInvestment, "InqueryInvestmentOrderBy"
modSYS.SetList Me!sInstrumentTypeCode, "InstrumentTypeFilter"
modSYS.SetList Me!sInqueryInvestmentStatusCode, "InqueryInvestmentStatusFilter"
modSYS.SetList Me!iCustomerBankID_InqueryInvestment, "CustomerBankFilter"
modSYS.SetList Me!sInstrumentTypeCode, "InstrumentTypeFilter"
modSYS.SetList Me!lstSort_InqueryAccount, "InqueryAccountOrderBy"
modSYS.SetList Me!sInqueryAccountStatusCode, "InqueryAccountStatusFilter"
modSYS.SetList Me!iCustomerBankID_InqueryAccount, "CustomerBankFilter"
Me!lstSort_Person = Me!lstSort_Person.ItemData( 0 )
Me!lstFilter_Person = Me!lstFilter_Person.ItemData( 0 )
Me!optFilter_Person = False
Me!optFilter_Person.Enabled = False
Me!btnQuickFind_Person.Enabled = False
Me!lstSort_InqueryInvestment = Me!lstSort_InqueryInvestment.ItemData( 0 )
Me!optFilter_InqueryInvestment = False
Me!optFilter_InqueryInvestment.Enabled = False
Me!btnQuickFind_InqueryInvestment.Enabled = False
Me!lstSort_InqueryAccount = Me!lstSort_InqueryAccount.ItemData( 0 )
Me!optFilter_InqueryAccount = False
Me!optFilter_InqueryAccount.Enabled = False
Me!btnQuickFind_InqueryAccount.Enabled = False
Call RequeryData
bLoading = False
Call Form_Current
Me.Painting = True: Me.Repaint
Application.Echo True
DoCmd.Hourglass False
exit_label:
Exit Sub
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Sub
'===========================================================
' Main Form - Загрузка данных
'===========================================================
Public Function MakeSQL() As String
On Error GoTo err_label
MakeSQL = modSYS.FormRecordSource("CustomerAll", "", "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData()
Me.RecordSource = MakeSQL
End Function
'===========================================================
' Sub 2 Customer - Загрузка данных
'===========================================================
Public Function MakeSQL_Customer() As String
On Error GoTo err_label
MakeSQL_Customer = modSYS.FormRecordSource _
("Customer", "", "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_Customer()
On Error GoTo err_label
DoCmd.Hourglass True
With Me!grcCustomerChild
If Me.ActiveControl.Name = "grcCustomerChild" Then
Me!btnTransparent.SetFocus
End If
.Visible = False
.Form.RecordSource = MakeSQL_Customer
.Visible = True
End With
DoCmd.Hourglass False
exit_label:
Exit Function
err_label:
Me!grcCustomerChild.Visible = True
DoCmd.Hourglass False
Call modError.ErrorMessage(Err.number, Err.Description)
Resume 'exit_label
End Function
'===========================================================
' Sub 3 Person - Загрузка данных
'===========================================================
Public Function MakeWhere_Person() As String
MakeWhere_Person = ""
If Me!optFilter_Person Then
If Me!txtQuickFind_Person <> "" Then
MakeWhere_Person = _
"(sPersonName1 LIKE '%" & Me!txtQuickFind_Person & "%' OR " & _
"sPersonName2 LIKE '%" & Me!txtQuickFind_Person & "%' OR " & _
"sPersonName3 LIKE '%" & Me!txtQuickFind_Person & "%' OR " & _
"sPersonPositionCode LIKE '%" & Me!txtQuickFind_Person & "%')"
End If
End If
' SELECT 0 AS iPersonPositionID, '<Все записи>' AS sPersonPositionCode, 0 AS iPersonPositionRank
' UNION ALL SELECT iPersonPositionID, sPersonPositionCode, iPersonPositionRank
' FROM TBD_PersonPosition
' ORDER BY iPersonPositionRank
If Me!lstFilter_Person <= 0 Then
MakeWhere_Person = MakeWhere_Person
Else
If Len(MakeWhere_Person) > 0 Then MakeWhere_Person = MakeWhere_Person & " AND "
MakeWhere_Person = MakeWhere_Person & _
"(iPersonPositionRank<=" & Me!lstFilter_Person.Column( 2 ) & ")"
End If
End Function
Public Function MakeOrderBy_Person() As String
MakeOrderBy_Person = Nz(Me!lstSort_Person.Column( 2 ), "")
End Function
Public Function MakeSQL_Person() As String
MakeSQL_Person = modSYS.FormRecordSource( _
"CustomerPerson", _
MakeWhere_Person, _
MakeOrderBy_Person)
End Function
Public Function RequeryData_Person()
DoCmd.Hourglass True
With Me!grcPerson
Me!btnTransparent.SetFocus
.Visible = False
Me.Repaint: Me.Painting = False
.Form.RecordSource = MakeSQL_Person
Me!btnOpenPerson.Enabled = _
.Form.Recordset.RecordCount > 0 _
And Not .Form.Recordset.BOF _
And Not .Form.Recordset.EOF
.Visible = True
.SetFocus
End With
Me.Painting = True
DoCmd.Hourglass False
exit_label:
Exit Function
err_label:
Me!grcPerson.Visible = True
DoCmd.Hourglass False
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 7 Investment - Загрузка данных
'===========================================================
Public Function MakeWhere_InqueryInvestment() As String
On Error GoTo err_label
Dim s As String: s = ""
If Nz(Me!optFilter_InqueryInvestment, False) Then
If Me!txtQuickFind_InqueryInvestment <> "" Then
s = _
"(sCustomerFilialName LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%' OR " & _
"sCustomerFilialReportName LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%' OR " & _
"sCustomerBankName LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%' OR " & _
"sCustomerBankReportName LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%' OR " & _
"sInqueryInvestmentOutCode LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%' OR " & _
"sInstrumentTypeName LIKE '%" & Me!txtQuickFind_InqueryInvestment.value & "%')"
End If
End If
Select Case Me!sInqueryInvestmentStatusCode
Case "<Все>"
s = s
Case Else
If DCount( _
"*", "DIC_InqueryInvestmentStatus", _
"sInqueryInvestmentStatusCode='" & Me!sInqueryInvestmentStatusCode & "'" _
) = 1 Then
If Len(s) > 0 Then s = s & " AND "
s = s & "(sInqueryInvestmentStatusCode='" & Me!sInqueryInvestmentStatusCode & "')"
Else
If Len(s) > 0 Then s = s & " AND "
s = s & Me!sInqueryInvestmentStatusCode
End If
End Select
Dim sCustomerField As String
If Me!sCustomerCreditFlag = "Y" Then
sCustomerField = "iCustomerFilialID"
ElseIf Me!iCustomerFilialLevel = 3 Then
sCustomerField = "iCustomerBankID"
End If
Select Case Me!iCustomerBankID_InqueryInvestment
Case 0 , - 1 :
s = s
Case Else:
If Len(s) > 0 Then s = s & " AND "
s = s & "(" & sCustomerField & "=" & Me!iCustomerBankID_InqueryInvestment & ")"
End Select
Select Case Me!sInstrumentTypeCode
Case "<Все>":
s = s
Case Else:
If Len(s) > 0 Then s = s & " AND "
s = s & "(sInstrumentTypeCode='" & Me!sInstrumentTypeCode & "')"
End Select
MakeWhere_InqueryInvestment = s
exit_label:
Exit Function
err_label:
If Err.number = 2427 Then
'Введенное выражение не содержит значения.
Resume Next
Else
Call modError.ErrorMessage(Err.number, Err.Description)
Resume 'exit_label
End If
End Function
Public Function MakeOrderBy_InqueryInvestment() As String
On Error GoTo err_label
MakeOrderBy_InqueryInvestment = Me!lstSort_InqueryInvestment.Column( 2 )
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function MakeSQL_InqueryInvestment() As String
On Error GoTo err_label
Dim sWhere As String, sOrderBy As String
Dim sFormWhere As String, sFormSource As String, sFormOrderBy As String
Dim sControlWhere As String, sControlOrderBy As String
sWhere = ""
sOrderBy = ""
modSYS.FormInfo "InqueryInvestment", sFormSource, sFormWhere, sFormOrderBy
sControlWhere = MakeWhere_InqueryInvestment
sControlOrderBy = MakeOrderBy_InqueryInvestment
If Len(sFormWhere) > 0 Then sWhere = "(" & sFormWhere & ")"
If Len(sControlWhere) > 0 Then
If Len(sWhere) > 0 Then sWhere = sWhere & " AND "
sWhere = sWhere & "(" & sControlWhere & ")"
End If
If Len(sControlOrderBy) > 0 Then
sOrderBy = sControlOrderBy
Else
If Len(sFormOrderBy) > 0 Then
If Len(sOrderBy) > 0 Then sOrderBy = sOrderBy & ", "
sOrderBy = sOrderBy & sFormOrderBy
End If
End If
If Len(sWhere) > 0 Then sWhere = "WHERE " & sWhere
If Len(sOrderBy) > 0 Then sOrderBy = "ORDER BY " & sOrderBy
MakeSQL_InqueryInvestment = "SELECT * FROM " & sFormSource & " " & sWhere & " " & sOrderBy
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_InqueryInvestment()
On Error GoTo err_label
On Error Resume Next
Me.Repaint: DoEvents
With Me!grcInqueryInvestment.Form
.RecordSource = MakeSQL_InqueryInvestment
If .Recordset.RecordCount > 0 Then
.Recordset.MoveLast
End If
End With
Me.Repaint: DoEvents
On Error GoTo 0
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 8 Account - Загрузка данных
'===========================================================
Public Function MakeWhere_InqueryAccount() As String
On Error GoTo err_label
Dim s As String: s = ""
If Nz(Me!optFilter_InqueryAccount, False) Then
If Nz(Me!txtQuickFind_InqueryAccount, "") <> "" Then
s = _
"(sCustomerFilialName LIKE '%" & Me!txtQuickFind_InqueryAccount.value & "%' OR " & _
"sCustomerFilialReportName LIKE '%" & Me!txtQuickFind_InqueryAccount.value & "%' OR " & _
"sCustomerBankName LIKE '%" & Me!txtQuickFind_InqueryAccount.value & "%' OR " & _
"sCustomerBankReportName LIKE '%" & Me!txtQuickFind_InqueryAccount.value & "%' OR " & _
"sInqueryAccountOutCode LIKE '%" & Me!txtQuickFind_InqueryAccount.value & "%')"
End If
End If
Select Case Nz(Me!sInqueryAccountStatusCode, "<Все>")
Case "<Все>"
s = s
Case Else
If DCount( _
"*", "DIC_InqueryAccountStatus", _
"sInqueryAccountStatusCode='" & Me!sInqueryAccountStatusCode & "'" _
) = 1 Then
If Len(s) > 0 Then s = s & " AND "
s = s & "(sInqueryAccountStatusCode='" & Me!sInqueryAccountStatusCode & "')"
Else
If Len(s) > 0 Then s = s & " AND "
s = s & Me!sInqueryAccountStatusCode
End If
End Select
Dim sCustomerField As String
If Me!sCustomerCreditFlag = "Y" Then
sCustomerField = "iCustomerFilialID"
ElseIf Me!iCustomerFilialLevel = 3 Then
sCustomerField = "iCustomerBankID"
End If
Select Case Me!iCustomerBankID_InqueryAccount
Case 0 , - 1 :
s = s
Case Else:
If Len(s) > 0 Then s = s & " AND "
s = s & "(" & sCustomerField & "=" & Me!iCustomerBankID_InqueryAccount & ")"
End Select
Select Case Me!sInstrumentTypeCode
Case "<Все>":
s = s
Case Else:
If Len(s) > 0 Then s = s & " AND "
s = s & "(sInstrumentTypeCode='" & Me!sInstrumentTypeCode & "')"
End Select
MakeWhere_InqueryAccount = s
exit_label:
Exit Function
err_label:
If Err.number = 2427 Then
'Введенное выражение не содержит значения.
Resume Next
Else
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End If
End Function
Public Function MakeOrderBy_InqueryAccount() As String
On Error GoTo err_label
MakeOrderBy_InqueryAccount = Nz(Me!lstSort_InqueryAccount.Column( 2 ), "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function MakeSQL_InqueryAccount() As String
On Error GoTo err_label
Dim sWhere As String, sOrderBy As String
Dim sFormWhere As String, sFormSource As String, sFormOrderBy As String
Dim sControlWhere As String, sControlOrderBy As String
sWhere = ""
sOrderBy = ""
modSYS.FormInfo "InqueryAccount", sFormSource, sFormWhere, sFormOrderBy
sControlWhere = MakeWhere_InqueryAccount
sControlOrderBy = MakeOrderBy_InqueryAccount
If Len(sFormWhere) > 0 Then sWhere = "(" & sFormWhere & ")"
If Len(sControlWhere) > 0 Then
If Len(sWhere) > 0 Then sWhere = sWhere & " AND "
sWhere = sWhere & "(" & sControlWhere & ")"
End If
If Len(sControlOrderBy) > 0 Then
sOrderBy = sControlOrderBy
Else
If Len(sFormOrderBy) > 0 Then
If Len(sOrderBy) > 0 Then sOrderBy = sOrderBy & ", "
sOrderBy = sOrderBy & sFormOrderBy
End If
End If
If Len(sWhere) > 0 Then sWhere = "WHERE " & sWhere
If Len(sOrderBy) > 0 Then sOrderBy = "ORDER BY " & sOrderBy
MakeSQL_InqueryAccount = "SELECT * FROM " & sFormSource & " " & sWhere & " " & sOrderBy
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_InqueryAccount()
On Error Resume Next
Me.Repaint: DoEvents
With Me!grcInqueryAccount.Form
.RecordSource = MakeSQL_InqueryAccount
If .Recordset.RecordCount > 0 Then .Recordset.MoveLast
End With
Me.Repaint: DoEvents
On Error GoTo 0
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 9 Raiting - Загрузка данных
'===========================================================
Public Function MakeSQL_Raiting() As String
On Error GoTo err_label
MakeSQL_Raiting = modSYS.FormRecordSource("CustomerRaitingBase", "", "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_Raiting()
On Error GoTo err_label
DoCmd.Hourglass True
With Me!grcRaiting
If Me.ActiveControl.Name = "grcRaiting" Then Me!btnTransparent.SetFocus
.Visible = False
.Form.RecordSource = MakeSQL_Raiting
.Visible = True
End With
DoCmd.Hourglass False
exit_label:
Exit Function
err_label:
Me!grcRaiting.Visible = True
DoCmd.Hourglass False
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 10 CustomerHistory - Загрузка данных
'===========================================================
Public Function MakeSQL_CustomerHistory() As String
On Error GoTo err_label
MakeSQL_CustomerHistory = modSYS.FormRecordSource("CustomerHistoryBase", "", "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_CustomerHistory()
On Error GoTo err_label
DoCmd.Hourglass True
With Me!grcCustomerHistory
If Me.ActiveControl.Name = "grcCustomerHistory" Then Me!btnTransparent.SetFocus
.Visible = False
.Form.RecordSource = MakeSQL_CustomerHistory
.Visible = True
End With
DoCmd.Hourglass False
exit_label:
Exit Function
err_label:
Me!grcCustomerHistory.Visible = True
DoCmd.Hourglass False
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 12 CustomerSource - Загрузка данных
'===========================================================
Public Function MakeSQL_CustomerSource() As String
On Error GoTo err_label
MakeSQL_CustomerSource = modSYS.FormRecordSource("CustomerSource", "", "")
exit_label:
Exit Function
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function RequeryData_CustomerSource()
On Error GoTo err_label
DoCmd.Hourglass True
With Me!grcCustomerSource
If Me.ActiveControl.Name = "grcCustomerSource" Then Me!btnTransparent.SetFocus
.Visible = False
.Form.RecordSource = MakeSQL_CustomerSource
.Visible = True
End With
DoCmd.Hourglass False
exit_label:
Exit Function
err_label:
Me!grcCustomerSource.Visible = True
DoCmd.Hourglass False
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' TabStrip - Переключение
'===========================================================
Private Sub tabStrip_Change()
Me.Repaint
Me.Painting = False
Select Case iTabIndex + 1
Case 2 : modCustomer.DisableCustomer Me
Case 3 : modCustomer.DisablePerson Me
Case 7 : modCustomer.DisableInvestment Me
Case 8 : modCustomer.DisableAccount Me
Case 9 : modCustomer.DisableRaiting Me
Case 10 : modCustomer.DisableCustomerHistory Me
Case 12 : modCustomer.DisableCustomerSource Me
End Select
Select Case Me.tabStrip + 1
Case 2 : modCustomer.EnableCustomer Me
Case 3 : modCustomer.EnablePerson Me: SetupPerson Me
Case 7 : modCustomer.EnableInvestment Me: SetupInvestment Me
Case 8 : modCustomer.EnableAccount Me: SetupAccount Me
Case 9 : modCustomer.EnableRaiting Me: SetupRaiting Me
Case 10 : modCustomer.EnableCustomerHistory Me: SetupCustomerHistory Me
Case 12 : modCustomer.EnableCustomerSource Me: SetupCustomerSource Me
End Select
iTabIndex = Me.tabStrip
modSYS.SaveUserSetting "Form.TreeCustomer.Tab", Me.tabStrip
Me.Painting = True
End Sub
'===========================================================
' Main Form - Обработка событий
'===========================================================
Private Sub btnRefresh_Click()
On Error GoTo err_label
If Me.Dirty Then Me.Dirty = False
Me!iCustomerParentID.Requery
Select Case (iTabIndex + 1 )
Case 2 : RequeryCustomer
Case 3 : RequeryPerson
Case 7 : RequeryInvestment
Case 8 : RequeryAccount
Case 9 : RequeryRaiting
Case 10 : RequeryCustomerHistory
Case 12 : RequeryCustomerSource
End Select
exit_sub:
Exit Sub
err_label:
If Err.number = 2101 Or Err.number = 2115 Or Err.number = 0 Then
'Введенное значение не подходит для данного свойства.
Err.Clear
Resume Next
Else
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_sub
End If
End Sub
Private Sub iCustomerParentID_AfterUpdate()
Me!btnOpenParentCustomer.Enabled = Not IsNull(Me!iCustomerParentID)
End Sub
Private Sub btnOpenTable_Click()
Call OpenCustomerTable
End Sub
Private Sub btnOpenTree_Click()
Call OpenCustomerTree
End Sub
Private Sub btnOpenParentCustomer_Click()
Call OpenParentCustomerForm
End Sub
Private Sub iCustomerTypeID_AfterUpdate()
Cal modCustomer.HandleCustomerTypeUpdate(frm)
End Sub
Private Sub sCustomerResidentFlag_AfterUpdate()
Call modCustomer.HandleResidentUpdate(frm)
End Sub
'===========================================================
' Sub 2 Customer - Обработка событий
'===========================================================
Public Sub CustomerChildGrid_Current()
On Error GoTo exit_sub
Me!btnOpenChildCustomer.Enabled = False
With Me!grcCustomerChild.Form
If .NewRecord Then GoTo exit_sub
If .Recordset.EOF Or .Recordset.BOF Then GoTo exit_sub
End With
Me!btnOpenChildCustomer.Enabled = True
exit_sub:
Exit Sub
End Sub
Private Sub CustomerChildGrid_DblClick(Cancel As Integer)
Call OpenChildCustomerForm
End Sub
Private Sub btnOpenChildCustomer_Click()
Call OpenChildCustomerForm
End Sub
'===========================================================
' Sub 3 Person - Обработка событий
'===========================================================
Private Sub lstSort_Person_AfterUpdate()
RequeryData_Person
End Sub
Private Sub lstFilter_Person_AfterUpdate()
RequeryData_Person
End Sub
Private Sub txtQuickFind_Person_Change()
If Len(Me!txtQuickFind_Person.Text) = 0 Then
Me!btnQuickFind_Person.Enabled = False
Me!optFilter_Person.Enabled = False
Exit Sub
End If
Me!btnQuickFind_Person.Enabled = True
Me!optFilter_Person.Enabled = True
Dim grcPerson As Form
Dim rsPerson As ADODB.Recordset
Set grcPerson = Me!grcPerson.Form
Set rsPerson = grcPerson.Recordset
Dim i As Long, sFoundField As String
If IsNumeric(Me!txtQuickFind_Person.Text) Then
Else
FIND_NAME:
Dim rsFind2 As ADODB.Recordset
Set rsFind2 = grcPerson.RecordsetClone
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName1 LIKE '" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName2 LIKE '" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName3 LIKE '" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName1 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName2 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcPerson.Bookmark
rsFind2.Find "sPersonName3 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sPersonName1 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sPersonName2 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sPersonName3 LIKE '%" & Me!txtQuickFind_Person.Text & "*'"
If Not rsFind2.EOF Then
rsPerson.MoveFirst
rsPerson.Find "iPersonID=" & rsFind2!iPersonID
grcPerson!iPersonID.SetFocus
GoTo exit_label
End If
End If
exit_label:
Set rsFind2 = Nothing
Exit Sub
End Sub
Private Sub btnQuickFind_Person_Click()
On Error GoTo Err_btnFindCustomer_Click
If IsNull(Me!txtQuickFind_Person) Then
Beep
Exit Sub
End If
If Len(Me!txtQuickFind_Person.value) = 0 Then
Beep
Exit Sub
End If
Me!txtQuickFind_Person.SetFocus
Call txtQuickFind_Person_Change
Exit_btnFindCustomer_Click:
Exit Sub
Err_btnFindCustomer_Click:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume Exit_btnFindCustomer_Click
End Sub
Private Sub optFilter_Person_AfterUpdate()
If Me!optFilter_Person Then
If IsNull(Me!txtQuickFind_Person.value) Or Me!txtQuickFind_Person.value = "" Then
Beep
Me!optFilter_Person = False
Me!grcPerson.SetFocus
Exit Sub
End If
End If
RequeryData
End Sub
Private Sub PersonGrid_Current()
Me!btnOpenPerson.Enabled = False
On Error Resume Next
If PersonGrid.NewRecord Then Exit Sub
If PersonGrid.Recordset.EOF Or PersonGrid.Recordset.BOF Then Exit Sub
If Err.number <> 0 Then Exit Sub
Err.Clear
Me!btnOpenPerson.Enabled = True
End Sub
Private Sub PersonGrid_DblClick(Cancel As Integer)
Call OpenPersonForm
End Sub
Private Sub btnOpenPerson_Click()
Call OpenPersonForm
End Sub
Private Sub btnOpenPersonTable_Click()
Call OpenPersonTable
End Sub
Private Sub btnCustomerPersonAdd_Click()
Call CustomerPersonAdd
End Sub
Private Sub btnOpenPersonPositionTable_Click()
Call OpenPersonPosition
End Sub
'===========================================================
' Sub 7 Investment - Обработка событий
'===========================================================
Private Sub lstSort_InqueryInvestment_AfterUpdate()
RequeryData_InqueryInvestment
End Sub
Private Sub iCustomerBankID_InqueryInvestment_AfterUpdate()
RequeryData_InqueryInvestment
End Sub
Private Sub sInqueryInvestmentStatusCode_AfterUpdate()
RequeryData_InqueryInvestment
End Sub
Private Sub sInstrumentTypeCode_AfterUpdate()
RequeryData_InqueryInvestment
End Sub
Private Sub optFilter_InqueryInvestment_AfterUpdate()
If Me!optFilter_InqueryInvestment Then
If _
IsNull(Me!txtQuickFind_InqueryInvestment.value) Or _
Me!txtQuickFind_InqueryInvestment.value = "" _
Then
Beep
Me!optFilter_InqueryInvestment = False
Me!grcInqueryInvestment.SetFocus
Exit Sub
End If
End If
RequeryData_InqueryInvestment
End Sub
Private Sub txtQuickFind_InqueryInvestment_Change()
If Len(Me!txtQuickFind_InqueryInvestment.Text) = 0 Then
Me!btnQuickFind_InqueryInvestment.Enabled = False
Me!optFilter_InqueryInvestment.Enabled = False
Exit Sub
End If
Me!btnQuickFind_InqueryInvestment.Enabled = True
Me!optFilter_InqueryInvestment.Enabled = True
Dim grcInqueryInvestment As Form
Set grcInqueryInvestment = Me!grcInqueryInvestment.Form
Dim i As Long, sFoundField As String
Dim rsFind As ADODB.Recordset
Dim rsData As ADODB.Recordset
Set rsFind = grcInqueryInvestment.RecordsetClone
Set rsData = grcInqueryInvestment.Recordset
rsFind.Bookmark = grcInqueryInvestment.Bookmark
If IsNumeric(Me!txtQuickFind_InqueryInvestment.Text) Then
i = CLng(Trim(Me!txtQuickFind_InqueryInvestment.Text))
rsFind.MoveFirst
While i < 99999999 #
rsFind.MoveFirst
rsFind.Find "iInqueryInvestmentID=" & CStr(i)
If Not rsFind.EOF Then
sFoundField = "iInqueryInvestmentID"
GoTo FOUND_NUMBER
Else
rsFind.MoveFirst
rsFind.Find "iInqueryInvestmentID >= " & CStr(i)
If Not rsFind.EOF Then
sFoundField = "iInqueryInvestmentID"
GoTo FOUND_NUMBER
End If
End If
i = i * 10
Wend
FOUND_NUMBER:
If Not rsFind.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind!iInqueryInvestmentID
grcInqueryInvestment.Controls(sFoundField).SetFocus
GoTo exit_label
Else
GoTo FIND_NAME
End If
Else
FIND_NAME:
Dim rsFind2 As ADODB.Recordset
Set rsFind2 = grcInqueryInvestment.RecordsetClone
Dim sCustomerRoot As String
If Me!sCustomerCreditFlag = "Y" Then
sCustomerRoot = "CustomerFilial"
ElseIf Me!iCustomerFilialLevel = 3 Then
sCustomerRoot = "CustomerBank"
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInstrumentTypeName LIKE '" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInstrumentTypeCode.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInqueryInvestmentOutCode LIKE '" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInqueryInvestmentOutCode.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInstrumentTypeName LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInstrumentTypeCode.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryInvestment.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInqueryInvestmentOutCode LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInqueryInvestmentOutCode.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sInstrumentTypeName LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInstrumentTypeCode.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sInqueryInvestmentOutCode LIKE '%" & Me!txtQuickFind_InqueryInvestment.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryInvestmentID=" & rsFind2!iInqueryInvestmentID
grcInqueryInvestment!sInqueryInvestmentOutCode.SetFocus
GoTo exit_label
End If
End If
exit_label:
Me!txtQuickFind_InqueryInvestment.SetFocus
Me!txtQuickFind_InqueryInvestment.SelStart = Len(Me!txtQuickFind_InqueryInvestment.Text)
Set rsFind2 = Nothing
Exit Sub
End Sub
Private Sub btnQuickFind_InqueryInvestment_Click()
On Error GoTo err_label
If IsNull(Me!txtQuickFind_InqueryInvestment) Then
Beep
Exit Sub
End If
If Len(Me!txtQuickFind_InqueryInvestment.value) = 0 Then
Beep
Exit Sub
End If
Me!txtQuickFind_InqueryInvestment.SetFocus
Call txtQuickFind_InqueryInvestment_Change
exit_label:
Exit Sub
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Sub
Private Sub InvestmentGrid_Current()
Me!btnTransparent.SetFocus
Me!btnInqueryInvestmentID.Enabled = False
Me!btnCustomerBankID_InqueryInvestment.Enabled = False
On Error Resume Next
If InvestmentGrid.NewRecord Then Exit Sub
If InvestmentGrid.Recordset.EOF Or InvestmentGrid.Recordset.BOF Then Exit Sub
If Err.number <> 0 Then Exit Sub
Err.Clear
Me!btnInqueryInvestmentID.Enabled = True
Me!btnCustomerBankID_InqueryInvestment.Enabled = True
End Sub
Private Sub InvestmentGrid_DblClick(Cancel As Integer)
Call OpenInqueryInvestment
End Sub
Private Sub btnInqueryInvestmentID_Click()
Call OpenInqueryInvestment
End Sub
Private Sub btnInqueryInvestmentTable_Click()
Call OpenInqueryInvestmentTable
End Sub
Private Sub btnInstrumentTypeCode_Click()
Call OpenInstrumentType
End Sub
Private Sub btnInqueryInvestmentStatusCode_Click()
Call OpenInqueryInvestmentStatusForm
End Sub
Private Sub btnCustomerBankID_InqueryInvestment_Click()
If Me!iCustomerFilialLevel = 3 Then
Call OpenInqueryInvestmentCustomerBank
ElseIf Me!sCustomerCreditFlag = "Y" Then
Call OpenInqueryInvestmentCustomerFilial
End If
End Sub
'===========================================================
' Sub 8 InqueryAccount - Обработка событий
'===========================================================
Private Sub lstSort_InqueryAccount_AfterUpdate()
RequeryData_InqueryAccount
End Sub
Private Sub iCustomerBankID_InqueryAccount_AfterUpdate()
RequeryData_InqueryAccount
End Sub
Private Sub sInqueryAccountStatusCode_AfterUpdate()
RequeryData_InqueryAccount
End Sub
Private Sub optFilter_InqueryAccount_AfterUpdate()
If Me!optFilter_InqueryAccount Then
If _
IsNull(Me!txtQuickFind_InqueryAccount.value) Or _
Me!txtQuickFind_InqueryAccount.value = "" _
Then
Beep
Me!optFilter_InqueryAccount = False
Me!grcInqueryAccount.SetFocus
Exit Sub
End If
End If
RequeryData_InqueryAccount
End Sub
Private Sub txtQuickFind_InqueryAccount_Change()
If Len(Me!txtQuickFind_InqueryAccount.Text) = 0 Then
Me!btnQuickFind_InqueryAccount.Enabled = False
Me!optFilter_InqueryAccount.Enabled = False
Exit Sub
End If
Me!btnQuickFind_InqueryAccount.Enabled = True
Me!optFilter_InqueryAccount.Enabled = True
Dim grcInqueryAccount As Form
Set grcInqueryAccount = Me!grcInqueryAccount.Form
Dim i As Long, sFoundField As String
Dim rsFind As ADODB.Recordset
Dim rsData As ADODB.Recordset
Set rsFind = grcInqueryAccount.RecordsetClone
Set rsData = grcInqueryAccount.Recordset
rsFind.Bookmark = grcInqueryAccount.Bookmark
If IsNumeric(Me!txtQuickFind_InqueryAccount.Text) Then
i = CLng(Trim(Me!txtQuickFind_InqueryAccount.Text))
rsFind.MoveFirst
While i < 99999999 #
rsFind.MoveFirst
rsFind.Find "iInqueryAccountID=" & CStr(i)
If Not rsFind.EOF Then
sFoundField = "iInqueryAccountID"
GoTo FOUND_NUMBER
Else
rsFind.MoveFirst
rsFind.Find "iInqueryAccountID >= " & CStr(i)
If Not rsFind.EOF Then
sFoundField = "iInqueryAccountID"
GoTo FOUND_NUMBER
End If
End If
i = i * 10
Wend
FOUND_NUMBER:
If Not rsFind.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind!iInqueryAccountID
grcInqueryAccount.Controls(sFoundField).SetFocus
GoTo exit_label
Else
GoTo FIND_NAME
End If
Else
FIND_NAME:
Dim rsFind2 As ADODB.Recordset
Set rsFind2 = grcInqueryAccount.RecordsetClone
Dim sCustomerRoot As String
If Me!sCustomerCreditFlag = "Y" Then
sCustomerRoot = "CustomerFilial"
ElseIf Me!iCustomerFilialLevel = 3 Then
sCustomerRoot = "CustomerBank"
End If
rsFind2.Bookmark = grcInqueryAccount.Bookmark
rsFind2.MoveNext
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryAccount.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInqueryAccountOutCode LIKE '" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount!sInqueryAccountOutCode.SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryAccount.Bookmark
rsFind2.MoveNext
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '%" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.Bookmark = grcInqueryAccount.Bookmark
rsFind2.MoveNext
rsFind2.Find "sInqueryAccountOutCode LIKE '%" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount!sInqueryAccountOutCode.SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "s" & sCustomerRoot & "Name LIKE '%" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount.Controls("i" & sCustomerRoot & "ID").SetFocus
GoTo exit_label
End If
rsFind2.MoveFirst
rsFind2.Find "sInqueryAccountOutCode LIKE '%" & Me!txtQuickFind_InqueryAccount.Text & "%'"
If Not rsFind2.EOF Then
rsData.MoveFirst
rsData.Find "iInqueryAccountID=" & rsFind2!iInqueryAccountID
grcInqueryAccount!sInqueryAccountOutCode.SetFocus
GoTo exit_label
End If
End If
exit_label:
Set rsFind2 = Nothing
Me!txtQuickFind_InqueryAccount.SetFocus
Me!txtQuickFind_InqueryAccount.SelStart = Len(Me!txtQuickFind_InqueryAccount.Text)
Exit Sub
End Sub
Private Sub btnQuickFind_InqueryAccount_Click()
On Error GoTo err_label
If IsNull(Me!txtQuickFind_InqueryAccount) Then
Beep
Exit Sub
End If
If Len(Me!txtQuickFind_InqueryAccount.value) = 0 Then
Beep
Exit Sub
End If
Me!txtQuickFind_InqueryAccount.SetFocus
Call txtQuickFind_InqueryAccount_Change
exit_label:
Exit Sub
err_label:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Sub
Private Sub AccountGrid_Current()
Me!btnInqueryAccountID.Enabled = False
Me!btnCustomerBankID_InqueryAccount.Enabled = False
On Error Resume Next
If AccountGrid.NewRecord Then Exit Sub
If AccountGrid.Recordset.EOF Or AccountGrid.Recordset.BOF Then Exit Sub
If Err.number <> 0 Then Exit Sub
Err.Clear
Me!btnInqueryAccountID.Enabled = True
Me!btnCustomerBankID_InqueryAccount.Enabled = True
End Sub
Private Sub AccountGrid_DblClick(Cancel As Integer)
Call OpenInqueryAccount
End Sub
Private Sub btnInqueryAccountID_Click()
Call OpenInqueryAccount
End Sub
Private Sub btnInqueryAccountTable_Click()
Call OpenInqueryAccountTable
End Sub
Private Sub btnInqueryAccountStatusCode_Click()
Call OpenInqueryAccountStatusForm
End Sub
Private Sub btnCustomerBankID_InqueryAccount_Click()
If Me!iCustomerFilialLevel = 3 Then
Call OpenInqueryAccountCustomerBank
ElseIf Me!sCustomerCreditFlag = "Y" Then
Call OpenInqueryAccountCustomerFilial
End If
End Sub
'===========================================================
' Sub 9 Raiting - Обработка событий
'===========================================================
Private Sub btnRaiting_Click()
Call OpenRaitingAgencyTable
End Sub
Private Sub btnRaitingTable_Click()
Call OpenCustomerRaitingTable
End Sub
'===========================================================
' Main Form
'===========================================================
Public Function OpenCustomerTable()
Dim id
If Me!iCustomerTypeID = 7000 Or Me!iCustomerTypeID = 8000 Then
Call modForm.GetObjectID(Me, "iCustomerID", id)
Call modBusiness.OpenCustomerInsuaranceTable(id)
Else
Call modForm.GetObjectID(Me, "iCustomerID", id)
Call modBusiness.OpenCustomerForm(id, "TABLE")
End If
End Function
Public Function OpenCustomerTree()
Dim id
Call modForm.GetObjectID(Me, "iCustomerID", id)
Call modBusiness.OpenCustomerForm(id, "TREE")
End Function
Public Function OpenParentCustomerForm()
On Error GoTo err_handler
If Me.NewRecord Then GoTo exit_label
If IsNull(Me!iCustomerParentID) Then GoTo exit_label
Dim id: id = Me!iCustomerParentID
With Me.Parent
.FindCustomerID id, True
!iCustomerID = id
End With
exit_label:
Exit Function
err_handler:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 2 Customer
'===========================================================
Public Function OpenChildCustomerForm()
On Error GoTo err_handler
If Me.NewRecord Then GoTo exit_label
If Me!grcCustomerChild.Form.NewRecord Then GoTo exit_label
If IsNull(Me!grcCustomerChild.Form!iCustomerID) Then GoTo exit_label
Dim id As Variant
id = Me!grcCustomerChild.Form!iCustomerID
With Me.Parent
.FindCustomerID id, True
!iCustomerID = id
End With
exit_label:
Exit Function
err_handler:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 3 Person
'===========================================================
Public Function OpenPersonForm()
Dim icID, ipID
Call modForm.GetObjectID(Me, "iCustomerID", icID)
Call modForm.GetObjectID(Me!grcPerson.Form, "iPersonID", ipID)
Call modBusiness.OpenPersonForm(ipID, "FORM", "iCustomerID", icID)
End Function
Public Function OpenPersonTable()
Dim icID, ipID
Call modForm.GetObjectID(Me, "iCustomerID", icID)
Call modForm.GetObjectID(Me!grcPerson.Form, "iPersonID", ipID)
Call modBusiness.OpenPersonForm(ipID, "TABLE", "iCustomerID", icID)
End Function
Public Function OpenPersonPosition()
On Error GoTo err_handler
Dim ipID, ippID
Call modForm.GetObjectID(Me!grcPerson.Form, "iPersonID", ipID)
Call modForm.GetObjectID(Me!grcPerson.Form, "iPersonPositionID", ippID)
Call modBusiness.OpenPersonPositionForm(ippID, "", "iPersonID", ipID)
exit_label:
Exit Function
err_handler:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
Public Function CustomerPersonAdd()
On Error GoTo err_handler
If Me.NewRecord Then Exit Function
modCustomer.AddCustomerPerson Me!grcPerson.Form
exit_label:
Exit Function
err_handler:
Call modError.ErrorMessage(Err.number, Err.Description)
Resume exit_label
End Function
'===========================================================
' Sub 7 Investment
'===========================================================
Public Function OpenInqueryInvestment()
Dim id
If modForm.GetObjectID(Me!grcInqueryInvestment.Form, "iInqueryInvestmentID", id) Then
Call modBusiness.OpenInqueryInvestmentForm(id)
Else
Call modBusiness.OpenInqueryInvestmentForm(Null, "TABLE")
End If
End Function
Public Function OpenInqueryInvestmentTable()
Dim id
Call modForm.GetObjectID(Me!grcInqueryInvestment.Form, "iInqueryInvestmentID", id)
Call modBusiness.OpenInqueryInvestmentForm(id, "TABLE")
End Function
Public Function OpenInqueryInvestmentCustomerBank()
Dim id
If Me!iCustomerFilialLevel = 3 Then
Call modForm.GetObjectID(Me!grcInqueryInvestment.Form, "iCustomerBankID", id)
Me.Parent.treeCustomer.SetFocus
Me.Parent!subCustomer.Visible = False
Me.Parent.lblSub.Visible = True
Me.Parent.Repaint
Me.Parent.Painting = False
Me.Parent.FindCustomerID id
Me.Parent.UpdateCustomer
Me.Parent!subCustomer.Visible = True
Me.Parent.lblSub.Visible = False
Me.Parent.Painting = True
End If
End Function
Public Function OpenInqueryInvestmentCustomerFilial()
Dim id
If Me!sCustomerCreditFlag = "Y" Then
Call modForm.GetObjectID(Me!grcInqueryInvestment.Form, "iCustomerFilialID", id)
Me.Parent.treeCustomer.SetFocus
Me.Parent!subCustomer.Visible = False
Me.Parent.lblSub.Visible = True
Me.Parent.Repaint
Me.Parent.Painting = False
Me.Parent.FindCustomerID id
Me.Parent.UpdateCustomer
Me.Parent!subCustomer.Visible = True
Me.Parent.lblSub.Visible = False
Me.Parent.Painting = True
End If
End Function
Public Function OpenInqueryInvestmentStatusForm()
Dim id
Call modForm.GetObjectID(Me!grcInqueryInvestment.Form, "sInqueryInvestmentStatusCode", id)
Call modBusiness.OpenInqueryInvestmentStatusForm(id)
End Function
Public Function OpenInstrumentType()
Dim id
Call modForm.GetObjectID(Me!grcInqueryInvestment.Form, "sInstrumentTypeCode", id)
Call modBusiness.OpenInstrumentTypeForm(id)
End Function
'===========================================================
' Sub 8 Account
'===========================================================
Public Function OpenInqueryAccount()
Dim id
If modForm.GetObjectID(Me!grcInqueryAccount.Form, "iInqueryAccountID", id) Then
Call modBusiness.OpenInqueryAccountForm(id)
Else
Call modBusiness.OpenInqueryAccountForm(Null, "TABLE")
End If
End Function
Public Function OpenInqueryAccountTable()
Dim id
Call modForm.GetObjectID(Me!grcInqueryAccount.Form, "iInqueryAccountID", id)
Call modBusiness.OpenInqueryAccountForm(id, "TABLE")
End Function
Public Function OpenInqueryAccountCustomerBank()
Dim id
If Me!iCustomerFilialLevel = 3 Then
Call modForm.GetObjectID(Me!grcInqueryAccount.Form, "iCustomerBankID", id)
Me.Parent.treeCustomer.SetFocus
Me.Parent!subCustomer.Visible = False
Me.Parent.lblSub.Visible = True
Me.Parent.Repaint
Me.Parent.Painting = False
Application.Echo False
Me.Parent.FindCustomerID id
Me.Parent.UpdateCustomer
Me.Parent!subCustomer.Visible = True
Me.Parent.lblSub.Visible = False
Me.Parent.Painting = True
Application.Echo True
End If
End Function
Public Function OpenInqueryAccountCustomerFilial()
Dim id
If Me!sCustomerCreditFlag = "Y" Then
Call modForm.GetObjectID(Me!grcInqueryAccount.Form, "iCustomerFilialID", id)
Me.Parent.treeCustomer.SetFocus
Me.Parent!subCustomer.Visible = False
Me.Parent.lblSub.Visible = True
Me.Parent.Repaint
Me.Parent.Painting = False
Application.Echo False
Me.Parent.FindCustomerID id
Me.Parent.UpdateCustomer
Me.Parent!subCustomer.Visible = True
Me.Parent.lblSub.Visible = False
Me.Parent.Painting = True
Application.Echo True
End If
End Function
Public Function OpenInqueryAccountStatusForm()
Dim id
Call modForm.GetObjectID(Me!grcInqueryAccount.Form, "sInqueryAccountStatusCode", id)
Call modBusiness.OpenInqueryAccountStatusForm(id)
End Function
'===========================================================
' Sub 9 Raiting
'===========================================================
Public Function OpenRaitingAgencyTable()
Call modBusiness.OpenRaitingAgencyTable
End Function
Public Function OpenCustomerRaitingTable()
Dim id
Call modForm.GetObjectID(Me, "iCustomerID", id)
Call modBusiness.OpenCustomerRaitingTable(id)
End Function
'===========================================================
' Resizing Form
'===========================================================
Public Sub ResizeSubForm(iFormHeight As Integer, iFormWidth As Integer)
Me.Painting = False
Me.Section( 0 ).Height = iFormHeight
Dim h, w
With Me!lblCustomerName
.Top = 100
.Left = 100
End With
With Me!sCustomerName
.Width = 0
.Top = Me!lblCustomerName.Top
.Left = Me!lblCustomerName.Left + Me!lblCustomerName.Width
w = iFormWidth - 270 - .Left - 100
If w < 1000 Then w = 1000
.Width = w
End With
With Me!lblCustomerReportName
.Top = Me!lblCustomerName.Top + Me!lblCustomerName.Height + 45
.Left = Me!lblCustomerName.Left
End With
With Me!sCustomerReportName
.Width = 0
.Top = Me!lblCustomerReportName.Top
.Left = Me!lblCustomerReportName.Left + Me!lblCustomerReportName.Width
.Width = w
End With
With Me!lblCustomerFullName
.Top = Me!lblCustomerReportName.Top + Me!lblCustomerReportName.Height + 30
.Left = Me!lblCustomerReportName.Left
End With
With Me!sCustomerFullName
.Width = 0
.Top = Me!lblCustomerFullName.Top
.Left = Me!lblCustomerFullName.Left + Me!lblCustomerFullName.Width
.Width = w
End With
With Me!lblCustomerParentID
.Top = Me!lblCustomerFullName.Top + Me!lblCustomerFullName.Height + 30
.Left = Me!lblCustomerFullName.Left
End With
With Me!iCustomerParentID
.Width = 0
.Top = Me!lblCustomerParentID.Top
.Left = Me!lblCustomerParentID.Left + Me!lblCustomerParentID.Width
.Width = w - Me!btnOpenParentCustomer.Width
End With
With Me!btnOpenParentCustomer
.Top = Me!iCustomerParentID.Top
.Left = Me!iCustomerParentID.Left + Me!iCustomerParentID.Width
.Height = Me!iCustomerParentID.Height
End With
Dim t, l
t = Me!lblCustomerParentID.Top + Me!lblCustomerParentID.Height + 100
l = Me!lblCustomerParentID.Left
h = iFormHeight - (Me!lblCustomerParentID.Top + Me!lblCustomerParentID.Height + 100 ) - 100
w = iFormWidth - 270 - Me!lblCustomerParentID.Left - 100
Dim htbs: htbs = h
Dim wtbs: wtbs = w
On Error Resume Next
Me.tabStrip.Height = 0
Me.tabStrip.Width = 0
Me.tabStrip.Top = t
Me.tabStrip.Left = l
Dim ctl As Control
For Each ctl In Me.Controls
With ctl
If InStr( 1 , .Tag, "wi") > 0 Then
.Width = 0
End If
If InStr( 1 , .Tag, "he") > 0 Then
.Height = 0
End If
If InStr( 1 , .Tag, "ta") > 0 Then
.Top = t + 500 : .Left = l + 300
End If
End With
Next ctl
Me.tabStrip.Height = 0
Me.tabStrip.Width = 0
Me.tabStrip.Top = t
Me.tabStrip.Left = l
Me.tabStrip.Height = h
Me.tabStrip.Width = w
On Error GoTo 0
t = Me.tabStrip.Top + 420
l = Me.tabStrip.Left + 140
Dim htab: htab = htbs - 420 - 140
Dim wtab: wtab = wtbs - 140 - 140
'=======================================================
' tab1Main
'=======================================================
' Me.tab1Main.SetFocus
With Me!lblCustomerTypeID
.Top = Me.tabStrip.Top + 420 + 100
.Left = Me.tabStrip.Left + 140 + 100
End With
With Me!iCustomerTypeID
.Top = Me!lblCustomerTypeID.Top
.Left = Me!lblCustomerTypeID.Left + Me!lblCustomerTypeID.Width + 100
End With
With Me!lblCustomerFilialLevel
.Top = Me!lblCustomerTypeID.Top + Me!lblCustomerTypeID.Height + 50
.Left = Me!lblCustomerTypeID.Left
End With
With Me!iCustomerFilialLevel
.Top = Me!lblCustomerFilialLevel.Top
.Left = Me!iCustomerTypeID.Left
End With
With Me!lblCustomerTypeExtra
.Top = Me!lblCustomerFilialLevel.Top + Me!lblCustomerFilialLevel.Height + 50
.Left = Me!lblCustomerFilialLevel.Left
End With
With Me!grcCustomerTypeExtra
.Top = Me!lblCustomerTypeExtra.Top + Me!lblCustomerTypeExtra.Height + 50
.Left = Me!lblCustomerTypeExtra.Left
.Width = Me!lblCustomerTypeID.Width + 100 + Me!iCustomerTypeID.Width
End With
With lblCustomerEmitentFlag
.Top = Me!grcCustomerTypeExtra.Top + Me!grcCustomerTypeExtra.Height + 100
.Left = Me!lblCustomerFilialLevel.Left
End With
With Me!sCustomerEmitentFlag
.Top = Me!lblCustomerEmitentFlag.Top
.Left = Me!lblCustomerEmitentFlag.Left + Me!lblCustomerEmitentFlag.Width + 100
End With
With lblCustomerContragentFlag
.Top = Me!lblCustomerEmitentFlag.Top + Me!lblCustomerEmitentFlag.Height + 50
.Left = Me!lblCustomerEmitentFlag.Left
End With
With Me!sCustomerContragentFlag
.Top = Me!lblCustomerContragentFlag.Top
.Left = Me!sCustomerEmitentFlag.Left
End With
With lblCustomerResidentFlag
.Top = Me!lblCustomerContragentFlag.Top + Me!lblCustomerContragentFlag.Height + 50
.Left = Me!lblCustomerContragentFlag.Left
End With
With Me!sCustomerResidentFlag
.Top = Me!lblCustomerResidentFlag.Top
.Left = Me!sCustomerContragentFlag.Left
End With
With Me.lblCountryCode
.Top = Me!sCustomerResidentFlag.Top + Me!sCustomerResidentFlag.Height + 50
.Left = Me!lblCustomerResidentFlag.Left
End With
With Me.iCountryCode
.Top = Me.lblCountryCode.Top
.Width = 0
.Left = Me.lblCountryCode.Left + Me.lblCountryCode.Width + 100
.Width = Me.tabStrip.Left + wtbs - .Left - 140
End With
With Me!lblCustomerOpenedDate
.Top = lblCustomerTypeID.Top
.Left = Me!iCustomerTypeID.Left + Me!iCustomerTypeID.Width + 200
End With
With Me.dtCustomerOpenedDate
.Top = Me!lblCustomerOpenedDate.Top
.Left = Me!lblCustomerOpenedDate.Left + Me!lblCustomerOpenedDate.Width + 100
End With
With Me!lblCustomerExpiredDate
.Top = Me!lblCustomerOpenedDate.Top + Me!lblCustomerOpenedDate.Height + 50
.Left = Me!lblCustomerOpenedDate.Left
End With
With Me.dtCustomerExpiredDate
.Top = Me!lblCustomerExpiredDate.Top
.Left = Me.dtCustomerOpenedDate.Left
End With
With Me!lblCustomerExpiredFlag
.Top = Me!lblCustomerExpiredDate.Top + Me!lblCustomerExpiredDate.Height + 50
.Left = Me!lblCustomerExpiredDate.Left
End With
With Me!sCustomerExpiredFlag
.Top = Me!lblCustomerExpiredFlag.Top
.Left = Me.dtCustomerExpiredDate.Left
End With
'=======================================================
' tab2Customer
'=======================================================
' Me.tab2Customer.SetFocus
With Me!btnOpenChildCustomer
.Top = t
.Left = l
End With
With Me!grcCustomerChild
.Top = Me!btnOpenChildCustomer.Top + Me!btnOpenChildCustomer.Height + 100
.Left = Me!btnOpenChildCustomer.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxCustomer.Move .Left, .Top, .Width, .Height
End With
'=======================================================
' tab3Person
'=======================================================
' Me.tab3Person.SetFocus
With Me!lblCustomerPerson
.Top = t
.Left = l
.Width = Me!btnCustomerPersonAdd.Width + 50 + Me!btnOpenPerson.Width + 50 + Me!btnOpenPersonTable.Width
End With
With Me!btnCustomerPersonAdd
.Top = Me!lblCustomerPerson.Top + Me!lblCustomerPerson.Height + 30
.Left = Me!lblCustomerPerson.Left
End With
With Me!btnOpenPerson
.Top = Me!btnCustomerPersonAdd.Top
.Left = Me!btnCustomerPersonAdd.Left + Me!btnCustomerPersonAdd.Width + 50
End With
With Me!btnOpenPersonTable
.Top = Me!btnOpenPerson.Top
.Left = Me!btnOpenPerson.Left + Me!btnOpenPerson.Width + 50
End With
With Me.lblPersonPosition
.Top = Me!lblCustomerPerson.Top
.Left = Me!lblCustomerPerson.Left + Me!lblCustomerPerson.Width + 100
.Width = Me!btnOpenPersonPositionTable.Width
End With
With Me!btnOpenPersonPositionTable
.Top = Me!btnOpenPersonTable.Top
.Left = Me.lblPersonPosition.Left
End With
w = wtab - Me!lblCustomerPerson.Left - Me!lblCustomerPerson.Width _
- 100 - Me.lblPersonPosition.Width _
- 100 - Me.lblSort_Person.Width - 50 _
- 100 - Me.lblQuickFind_Person.Width - 50 _
- Me!btnQuickFind_Person.Width _
- Me!optFilter_Person.Width
w = w / 3
If w < 400 Then w = 400
With Me.lblSort_Person
.Top = Me.lblPersonPosition.Top
.Left = Me.lblPersonPosition.Left + Me.lblPersonPosition.Width + 100
End With
With Me!lstSort_Person
.Top = Me.lblSort_Person.Top
.Left = Me.lblSort_Person.Left + Me.lblSort_Person.Width + 50
.Width = 2 * w
End With
With Me.lblFilter_Person
.Top = Me.lblSort_Person.Top + Me.lblSort_Person.Height
.Left = Me.lblSort_Person.Left
End With
With Me!lstFilter_Person
.Top = Me.lblFilter_Person.Top
.Left = Me!lstSort_Person.Left
.Width = 2 * w
End With
With Me.lblQuickFind_Person
.Top = Me!lstSort_Person.Top
.Left = Me!lstSort_Person.Left + Me!lstSort_Person.Width + 100
End With
With Me!txtQuickFind_Person
.Top = Me.lblQuickFind_Person.Top
.Left = Me.lblQuickFind_Person.Left + Me.lblQuickFind_Person.Width
.Width = w
End With
With Me!btnQuickFind_Person
.Top = Me!txtQuickFind_Person.Top
.Left = Me!txtQuickFind_Person.Left + Me!txtQuickFind_Person.Width
End With
With Me!optFilter_Person
.Top = Me!btnQuickFind_Person.Top
.Left = Me!btnQuickFind_Person.Left + Me!btnQuickFind_Person.Width
End With
With Me!grcPerson
.Top = Me!btnCustomerPersonAdd.Top + Me!btnCustomerPersonAdd.Height + 100
.Left = Me!btnCustomerPersonAdd.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140 - 100 - Me.lblPhone.Height
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxPerson.Move .Left, .Top, .Width, .Height
End With
With Me.lblPhone
.Left = Me!grcPerson.Left
.Top = Me!grcPerson.Top + Me!grcPerson.Height + 100
.Width = Me!grcPerson.Width
End With
'=======================================================
' tab4Registration
'=======================================================
' Me.tab4Registration.SetFocus
With Me!lblCustomerChamberCode
.Top = t + 100
.Left = l + 100
End With
With Me!sCustomerChamberCode
.Top = Me!lblCustomerChamberCode.Top
.Left = Me!lblCustomerChamberCode.Left + Me!lblCustomerChamberCode.Width + 50
End With
With Me!lblCustomerChamberDate
.Top = Me!sCustomerChamberCode.Top
.Left = Me!sCustomerChamberCode.Left + Me!sCustomerChamberCode.Width + 100
End With
With Me.dtCustomerChamberDate
.Top = Me!lblCustomerChamberDate.Top
.Left = Me!lblCustomerChamberDate.Left + Me!lblCustomerChamberDate.Width + 50
End With
With Me!lblCustomerChamberComment
.Top = Me.dtCustomerChamberDate.Top
.Left = Me.dtCustomerChamberDate.Left + Me.dtCustomerChamberDate.Width + 50
End With
With Me!lblCustomerOGRNCode
.Top = Me!lblCustomerChamberCode.Top + Me!lblCustomerChamberCode.Height + 100
.Left = Me!lblCustomerChamberCode.Left
End With
With Me!sCustomerOGRNCode
.Top = Me!lblCustomerOGRNCode.Top
.Left = Me!sCustomerChamberCode.Left
End With
With Me!lblCustomerOGRNDate
.Top = Me!sCustomerOGRNCode.Top
.Left = Me!sCustomerOGRNCode.Left + Me!sCustomerOGRNCode.Width + 100
End With
With Me.dtCustomerOGRNDate
.Top = Me!lblCustomerOGRNDate.Top
.Left = Me!lblCustomerOGRNDate.Left + Me!lblCustomerOGRNDate.Width + 50
End With
With Me!lblCustomerOGRNComment
.Top = Me.dtCustomerOGRNDate.Top
.Left = Me.dtCustomerOGRNDate.Left + Me.dtCustomerOGRNDate.Width + 50
End With
With Me!lblCustomerINNCode
.Top = Me!lblCustomerOGRNCode.Top + Me!lblCustomerOGRNCode.Height + 100
.Left = Me!lblCustomerOGRNCode.Left
End With
With Me!sCustomerINNCode
.Top = Me!lblCustomerINNCode.Top
.Left = Me!sCustomerOGRNCode.Left
End With
With Me!lblCustomerKPPCode
.Top = Me!lblCustomerINNCode.Top
.Left = Me!sCustomerINNCode.Left + Me!sCustomerINNCode.Width + 100
End With
With Me!sCustomerKPPCode
.Top = Me!lblCustomerKPPCode.Top
.Left = Me!lblCustomerKPPCode.Left + Me!lblCustomerKPPCode.Width + 50
End With
With Me!lblCustomerINNKPPDate
.Top = Me!sCustomerKPPCode.Top
.Left = Me!sCustomerKPPCode.Left + Me!sCustomerKPPCode.Width + 100
End With
With Me.dtCustomerINNKPPDate
.Top = Me!lblCustomerINNKPPDate.Top
.Left = Me!lblCustomerINNKPPDate.Left + Me!lblCustomerINNKPPDate.Width + 50
End With
With Me!lblCustomerOKPOCode
.Top = Me!lblCustomerINNCode.Top + Me!lblCustomerINNCode.Height + 100
.Left = Me!lblCustomerINNCode.Left
End With
With Me!sCustomerOKPOCode
.Top = Me!lblCustomerOKPOCode.Top
.Left = Me!sCustomerINNCode.Left
End With
With Me!lblCustomerBIKCode
.Top = Me!sCustomerOKPOCode.Top
.Left = Me!sCustomerOKPOCode.Left + Me!sCustomerOKPOCode.Width + 100
End With
With Me!sCustomerBIKCode
.Top = Me!lblCustomerBIKCode.Top
.Left = Me!lblCustomerBIKCode.Left + Me!lblCustomerBIKCode.Width + 50
End With
With Me!lblCustomerRegistrationCode
.Top = Me!lblCustomerOKPOCode.Top + Me!lblCustomerOKPOCode.Height + 100
.Left = Me!lblCustomerOKPOCode.Left
End With
With Me!iCustomerRegistrationCode
.Top = Me!lblCustomerRegistrationCode.Top
.Left = Me!sCustomerOKPOCode.Left
End With
With Me!lblCustomerRegistrationDate
.Top = Me!iCustomerRegistrationCode.Top
.Left = Me!iCustomerRegistrationCode.Left + Me!iCustomerRegistrationCode.Width + 100
End With
With Me.dtCustomerRegistrationDate
.Top = Me!lblCustomerRegistrationDate.Top
.Left = Me!lblCustomerRegistrationDate.Left + Me!lblCustomerRegistrationDate.Width + 50
End With
With Me!lblCustomerRegistrationRevokeFlag
.Top = Me.dtCustomerRegistrationDate.Top
.Left = Me.dtCustomerRegistrationDate.Left + Me.dtCustomerRegistrationDate.Width + 100
End With
With Me!sCustomerRegistrationRevokeFlag
.Top = Me!lblCustomerRegistrationRevokeFlag.Top
.Left = Me!lblCustomerRegistrationRevokeFlag.Left + Me!lblCustomerRegistrationRevokeFlag.Width + 50
End With
With Me!lblCustomerInsuaranceData
.Top = Me!lblCustomerRegistrationCode.Top + Me!lblCustomerRegistrationCode.Height + 100
.Left = Me!lblCustomerRegistrationCode.Left
End With
With Me!grcCustomerInsuaranceData
.Top = Me!lblCustomerInsuaranceData.Top + Me!lblCustomerInsuaranceData.Height + 50
.Left = Me!lblCustomerInsuaranceData.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
End With
'=======================================================
' tab5Comment
'=======================================================
' Me.tab5Comment.SetFocus
With Me!lblCustomerComment
.Top = t
.Left = l
End With
With Me!sCustomerComment
.Top = Me!lblCustomerComment.Top
.Left = Me!lblCustomerComment.Left + Me!lblCustomerComment.Width + 50
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
End With
'=======================================================
' tab6Declension
'=======================================================
' Me.tab6Declension.SetFocus
With Me!lblCustomerDeclension
.Top = t
.Left = l
.Width = Me.tabStrip.Left + wtbs - .Left - 140
End With
With Me!grcCustomerDeclension
.Top = Me!lblCustomerDeclension.Top + Me!lblCustomerDeclension.Height + 50
.Left = Me!lblCustomerDeclension.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
End With
'=======================================================
' tab7InqueryInvestment
'=======================================================
' Me.tab7InqueryInvestment.SetFocus
With Me.lblInqueryInvestment
.Top = t
.Left = l
.Width = Me!btnInqueryInvestmentID.Width + 50 + Me!btnInqueryInvestmentTable.Width
End With
With Me!btnInqueryInvestmentID
.Top = Me.lblInqueryInvestment.Top + Me.lblInqueryInvestment.Height + 30
.Left = Me.lblInqueryInvestment.Left
End With
With Me!btnInqueryInvestmentTable
.Top = Me!btnInqueryInvestmentID.Top
.Left = Me!btnInqueryInvestmentID.Left + Me!btnInqueryInvestmentID.Width + 50
End With
With Me!lblCustomerBank_InqueryInvestment
.Top = Me.lblInqueryInvestment.Top
.Left = Me!btnInqueryInvestmentTable.Left + Me!btnInqueryInvestmentTable.Width + 100
.Width = Me!btnCustomerBankID_InqueryInvestment.Width
End With
With Me!btnCustomerBankID_InqueryInvestment
.Top = Me!lblCustomerBank_InqueryInvestment.Top + Me!lblCustomerBank_InqueryInvestment.Height + 30
.Left = Me!lblCustomerBank_InqueryInvestment.Left
End With
With Me.lblDictionary_InqueryInvestment
.Top = Me!lblCustomerBank_InqueryInvestment.Top
.Left = Me!lblCustomerBank_InqueryInvestment.Left + Me!lblCustomerBank_InqueryInvestment.Width + 100
.Width = Me!btnInstrumentTypeCode.Width + 50 + Me!btnInqueryInvestmentStatusCode.Width
End With
With Me!btnInstrumentTypeCode
.Top = Me.lblDictionary_InqueryInvestment.Top + Me.lblDictionary_InqueryInvestment.Height + 30
.Left = Me.lblDictionary_InqueryInvestment.Left
End With
With Me!btnInqueryInvestmentStatusCode
.Top = Me!btnInstrumentTypeCode.Top
.Left = Me!btnInstrumentTypeCode.Left + Me!btnInstrumentTypeCode.Width + 50
End With
w = wtab - Me.lblDictionary_InqueryInvestment.Left - Me.lblDictionary_InqueryInvestment.Width _
- 100 - Me.lblSort_InqueryInvestment.Width _
- 100 - Me!lblCustomerBankID_InqueryInvestment.Width _
- 100 - Me.lblQuickFind_InqueryInvestment.Width _
- Me!btnQuickFind_InqueryInvestment.Width _
- Me!optFilter_InqueryInvestment.Width
w = w * 0 . 2
If w < 100 Then w = 100
With Me.lblSort_InqueryInvestment
.Top = Me.lblDictionary_InqueryInvestment.Top
.Left = Me.lblDictionary_InqueryInvestment.Left + Me.lblDictionary_InqueryInvestment.Width + 100
End With
With Me!lstSort_InqueryInvestment
.Top = Me.lblSort_InqueryInvestment.Top
.Left = Me.lblSort_InqueryInvestment.Left + Me.lblSort_InqueryInvestment.Width
.Width = w * 2
End With
With Me.lblInstrumentTypeCode
.Top = Me.lblSort_InqueryInvestment.Top + Me.lblSort_InqueryInvestment.Height
.Left = Me.lblSort_InqueryInvestment.Left
End With
With Me!sInstrumentTypeCode
.Top = Me.lblInstrumentTypeCode.Top
.Left = Me!lstSort_InqueryInvestment.Left
.Width = w * 2
End With
With Me!lblCustomerBankID_InqueryInvestment
.Top = Me.lblSort_InqueryInvestment.Top
.Left = Me!lstSort_InqueryInvestment.Left + Me!lstSort_InqueryInvestment.Width + 100
End With
With Me!iCustomerBankID_InqueryInvestment
.Top = Me!lblCustomerBankID_InqueryInvestment.Top
.Left = Me!lblCustomerBankID_InqueryInvestment.Left + Me!lblCustomerBankID_InqueryInvestment.Width
.Width = w * 2
End With
With Me.lblInqueryInvestmentStatusCode
.Top = Me.lblInstrumentTypeCode.Top
.Left = Me!lblCustomerBankID_InqueryInvestment.Left
End With
With Me!sInqueryInvestmentStatusCode
.Top = Me.lblInqueryInvestmentStatusCode.Top
.Left = Me!iCustomerBankID_InqueryInvestment.Left
.Width = w * 2
End With
With Me.lblQuickFind_InqueryInvestment
.Top = Me!lblCustomerBankID_InqueryInvestment.Top
.Left = Me!iCustomerBankID_InqueryInvestment.Left + Me!iCustomerBankID_InqueryInvestment.Width + 100
End With
With Me!txtQuickFind_InqueryInvestment
.Top = Me.lblQuickFind_InqueryInvestment.Top
.Left = Me.lblQuickFind_InqueryInvestment.Left + Me.lblQuickFind_InqueryInvestment.Width
.Width = w
End With
With Me!btnQuickFind_InqueryInvestment
.Top = Me!txtQuickFind_InqueryInvestment.Top
.Left = Me!txtQuickFind_InqueryInvestment.Left + Me!txtQuickFind_InqueryInvestment.Width
End With
With Me!optFilter_InqueryInvestment
.Top = Me!btnQuickFind_InqueryInvestment.Top
.Left = Me!btnQuickFind_InqueryInvestment.Left + Me!btnQuickFind_InqueryInvestment.Width
End With
With Me!grcInqueryInvestment
.Top = Me!btnInqueryInvestmentID.Top + Me!btnInqueryInvestmentID.Height + 50
.Left = Me!btnInqueryInvestmentID.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxInqueryInvestment.Move .Left, .Top, .Width, .Height
End With
'=======================================================
' tab8InqueryAccount
'=======================================================
' Me.tab8InqueryAccount.SetFocus
With Me.lblInqueryAccount
.Top = t
.Left = l
.Width = Me!btnInqueryAccountID.Width + 50 + Me!btnInqueryAccountTable.Width
End With
With Me!btnInqueryAccountID
.Top = Me.lblInqueryAccount.Top + Me.lblInqueryAccount.Height + 30
.Left = Me.lblInqueryAccount.Left
End With
With Me!btnInqueryAccountTable
.Top = Me!btnInqueryAccountID.Top
.Left = Me!btnInqueryAccountID.Left + Me!btnInqueryAccountID.Width + 50
End With
With Me!lblCustomerBank_InqueryAccount
.Top = Me.lblInqueryAccount.Top
.Left = Me!btnInqueryAccountTable.Left + Me!btnInqueryAccountTable.Width + 100
.Width = Me!btnCustomerBankID_InqueryAccount.Width
End With
With Me!btnCustomerBankID_InqueryAccount
.Top = Me!lblCustomerBank_InqueryAccount.Top + Me!lblCustomerBank_InqueryAccount.Height + 30
.Left = Me!lblCustomerBank_InqueryAccount.Left
End With
With Me.lblDictionary_InqueryAccount
.Top = Me!lblCustomerBank_InqueryAccount.Top
.Left = Me!lblCustomerBank_InqueryAccount.Left + Me!lblCustomerBank_InqueryAccount.Width + 100
.Width = Me!btnInqueryAccountStatusCode.Width
End With
With Me!btnInqueryAccountStatusCode
.Top = Me.lblDictionary_InqueryAccount.Top + Me.lblDictionary_InqueryAccount.Height + 30
.Left = Me.lblDictionary_InqueryAccount.Left
End With
w = wtab _
- Me.lblDictionary_InqueryAccount.Left - Me.lblDictionary_InqueryAccount.Width _
- 100 - Me.lblSort_InqueryAccount.Width _
- 100 - Me!lblCustomerBankID_InqueryAccount.Width _
- 100 - Me.lblQuickFind_InqueryAccount.Width _
- Me!btnQuickFind_InqueryAccount.Width _
- Me!optFilter_InqueryAccount.Width
w = w * 0 . 2
If w < 100 Then w = 100
With Me.lblSort_InqueryAccount
.Top = Me.lblDictionary_InqueryAccount.Top
.Left = Me.lblDictionary_InqueryAccount.Left + Me.lblDictionary_InqueryAccount.Width + 100
End With
With Me!lstSort_InqueryAccount
.Top = Me.lblSort_InqueryAccount.Top
.Left = Me.lblSort_InqueryAccount.Left + Me.lblSort_InqueryAccount.Width
.Width = w * 2
End With
With Me!lblCustomerBankID_InqueryAccount
.Top = Me.lblSort_InqueryAccount.Top
.Left = Me!lstSort_InqueryAccount.Left + Me!lstSort_InqueryAccount.Width + 100
End With
With Me!iCustomerBankID_InqueryAccount
.Top = Me!lblCustomerBankID_InqueryAccount.Top
.Left = Me!lblCustomerBankID_InqueryAccount.Left + Me!lblCustomerBankID_InqueryAccount.Width
.Width = w * 2
End With
With Me.lblInqueryAccountStatusCode
.Top = Me!lblCustomerBankID_InqueryAccount.Top + Me!lblCustomerBankID_InqueryAccount.Height
.Left = Me!lblCustomerBankID_InqueryAccount.Left
End With
With Me!sInqueryAccountStatusCode
.Top = Me.lblInqueryAccountStatusCode.Top
.Left = Me!iCustomerBankID_InqueryAccount.Left
.Width = w * 2
End With
With Me.lblQuickFind_InqueryAccount
.Top = Me!lblCustomerBankID_InqueryAccount.Top
.Left = Me!iCustomerBankID_InqueryAccount.Left + Me!iCustomerBankID_InqueryAccount.Width + 100
End With
With Me!txtQuickFind_InqueryAccount
.Top = Me.lblQuickFind_InqueryAccount.Top
.Left = Me.lblQuickFind_InqueryAccount.Left + Me.lblQuickFind_InqueryAccount.Width
.Width = w
End With
With Me!btnQuickFind_InqueryAccount
.Top = Me!txtQuickFind_InqueryAccount.Top
.Left = Me!txtQuickFind_InqueryAccount.Left + Me!txtQuickFind_InqueryAccount.Width
End With
With Me!optFilter_InqueryAccount
.Top = Me!btnQuickFind_InqueryAccount.Top
.Left = Me!btnQuickFind_InqueryAccount.Left + Me!btnQuickFind_InqueryAccount.Width
End With
With Me!grcInqueryAccount
.Top = Me!btnInqueryAccountID.Top + Me!btnInqueryAccountID.Height + 50
.Left = Me!btnInqueryAccountID.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxInqueryAccount.Move .Left, .Top, .Width, .Height
End With
'=======================================================
' tab9Raiting
'=======================================================
' Me.tab9Raiting.SetFocus
With Me!btnRaiting
.Left = l
.Top = t
End With
With Me!btnRaitingTable
.Left = Me!btnRaiting.Left + Me!btnRaiting.Width + 100
.Top = Me!btnRaiting.Top
End With
With Me!grcRaiting
.Top = Me!btnRaiting.Top + Me!btnRaiting.Height + 85
.Left = Me!btnRaiting.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxRaiting.Move .Left, .Top, .Width, .Height
End With
'=======================================================
' tab10CustomerHistory
'=======================================================
' Me.tab10CustomerHistory.SetFocus
With Me!lblCustomerHistory
.Left = l
.Top = t
End With
With Me!grcCustomerHistory
.Top = Me!lblCustomerHistory.Top + Me!lblCustomerHistory.Height + 50
.Left = Me!lblCustomerHistory.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxCustomerHistory.Move .Left, .Top, .Width, .Height
End With
'=======================================================
' tab11Contact
'=======================================================
' Me.tab11Contact.SetFocus
w = wtab - 100 - Me!lblCustomerPhone1.Width _
- 50 - 100 - Me!lblCustomerFax1.Width - 50 - 100
w = w / 2
With lblCustomerPhone1
.Top = Me.tabStrip.Top + 420 + 100
.Left = Me.tabStrip.Left + 140 + 100
End With
With Me!sCustomerPhone1
.Top = Me!lblCustomerPhone1.Top
.Left = Me!lblCustomerPhone1.Left + Me!lblCustomerPhone1.Width + 50
.Width = w
End With
With lblCustomerPhone2
.Top = Me!lblCustomerPhone1.Top + Me!lblCustomerPhone1.Height + 100
.Left = Me!lblCustomerPhone1.Left
End With
With Me!sCustomerPhone2
.Top = Me!lblCustomerPhone2.Top
.Left = Me!sCustomerPhone1.Left
.Width = Me!sCustomerPhone1.Width
End With
With lblCustomerFax1
.Top = Me!lblCustomerPhone1.Top
.Left = Me!sCustomerPhone1.Left + Me!sCustomerPhone1.Width + 100
End With
With Me!sCustomerFax1
.Top = Me!lblCustomerFax1.Top
.Left = Me!lblCustomerFax1.Left + Me!lblCustomerFax1.Width + 50
.Width = w
End With
With lblCustomerFax2
.Top = Me!lblCustomerPhone2.Top
.Left = Me!lblCustomerFax1.Left
End With
With Me!sCustomerFax2
.Top = Me!lblCustomerPhone2.Top
.Left = Me!sCustomerFax1.Left
.Width = Me!sCustomerFax1.Width
End With
With Me!lblCustomerAddress
.Top = Me!lblCustomerPhone2.Top + Me!lblCustomerPhone2.Height + 100
.Left = Me!lblCustomerPhone2.Left
End With
With Me!sCustomerAddress
.Top = Me!lblCustomerAddress.Top
.Left = Me!lblCustomerAddress.Left + Me!lblCustomerAddress.Width + 50
.Width = Me.tabStrip.Left + wtbs - .Left - 140 - 100
End With
With Me!lblCustomerAddressPost
.Top = Me!lblCustomerAddress.Top + Me!lblCustomerAddress.Height + 100
.Left = Me!lblCustomerAddress.Left
End With
With Me!sCustomerAddressPost
.Top = Me!lblCustomerAddressPost.Top
.Left = Me!lblCustomerAddressPost.Left + Me!lblCustomerAddressPost.Width + 50
.Width = Me.tabStrip.Left + wtbs - .Left - 140 - 100
End With
With Me!lblCustomerEmail
.Top = Me!lblCustomerAddressPost.Top + Me!lblCustomerAddressPost.Height + 100
.Left = Me!lblCustomerAddressPost.Left
End With
With Me!sCustomerEmail
.Top = Me!lblCustomerEmail.Top
.Left = Me!lblCustomerEmail.Left + Me!lblCustomerEmail.Width + 50
.Width = w
End With
With Me!lblCustomerWWW
.Top = Me!lblCustomerEmail.Top
.Left = Me!lblCustomerFax2.Left
End With
With Me!sCustomerWWW
.Top = Me!lblCustomerWWW.Top
.Left = Me!sCustomerFax2.Left
.Width = Me!sCustomerFax2.Width
End With
'=======================================================
' tab12CustomerSource
'=======================================================
' Me.tab12CustomerSource.SetFocus
With Me!btnCustomerSource
.Left = l
.Top = t
End With
With Me!grcCustomerSource
.Top = Me!btnCustomerSource.Top + Me!btnCustomerSource.Height + 90
.Left = Me!btnCustomerSource.Left
.Height = Me.tabStrip.Top + htbs - .Top - 140
.Width = Me.tabStrip.Left + wtbs - .Left - 140
Me.boxCustomerSource.Move .Left, .Top, .Width, .Height
End With
GoTo End_Proc
End_Proc:
Me.Section( 0 ).Height = iFormHeight
Me.Painting = True
End Sub