frm_Admin.bas 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. Version =20
  2. VersionRequired =20
  3. Begin Form
  4. RecordSelectors = NotDefault
  5. MaxButton = NotDefault
  6. MinButton = NotDefault
  7. ControlBox = NotDefault
  8. AutoCenter = NotDefault
  9. NavigationButtons = NotDefault
  10. DividingLines = NotDefault
  11. AllowDesignChanges = NotDefault
  12. DefaultView =0
  13. ScrollBars =0
  14. PictureAlignment =2
  15. DatasheetGridlinesBehavior =3
  16. GridY =10
  17. Width =10714
  18. DatasheetFontHeight =11
  19. ItemSuffix =16
  20. Right =9030
  21. Bottom =12345
  22. DatasheetGridlinesColor =14806254
  23. RecSrcDt = Begin
  24. 0x98cd09ff0f38e440
  25. End
  26. OnCurrent ="[Event Procedure]"
  27. DatasheetFontName ="Calibri"
  28. PrtMip = Begin
  29. 0x6801000068010000680100006801000000000000201c0000e010000001000000 ,
  30. 0x010000006801000000000000a10700000100000001000000
  31. End
  32. FilterOnLoad =0
  33. ShowPageMargins =0
  34. DisplayOnSharePointSite =1
  35. DatasheetAlternateBackColor =15921906
  36. DatasheetGridlinesColor12 =0
  37. FitToScreen =1
  38. DatasheetBackThemeColorIndex =1
  39. BorderThemeColorIndex =3
  40. ThemeFontIndex =1
  41. ForeThemeColorIndex =0
  42. AlternateBackThemeColorIndex =1
  43. AlternateBackShade =95.0
  44. Begin
  45. Begin Label
  46. BackStyle =0
  47. FontSize =11
  48. FontName ="Calibri"
  49. ThemeFontIndex =1
  50. BackThemeColorIndex =1
  51. BorderThemeColorIndex =0
  52. BorderTint =50.0
  53. ForeThemeColorIndex =0
  54. ForeTint =50.0
  55. GridlineThemeColorIndex =1
  56. GridlineShade =65.0
  57. End
  58. Begin CommandButton
  59. Width =1701
  60. Height =283
  61. FontSize =11
  62. FontWeight =400
  63. FontName ="Calibri"
  64. ForeThemeColorIndex =0
  65. ForeTint =75.0
  66. GridlineThemeColorIndex =1
  67. GridlineShade =65.0
  68. UseTheme =1
  69. Shape =1
  70. Gradient =12
  71. BackThemeColorIndex =4
  72. BackTint =60.0
  73. BorderLineStyle =0
  74. BorderColor =16777215
  75. BorderThemeColorIndex =4
  76. BorderTint =60.0
  77. ThemeFontIndex =1
  78. HoverThemeColorIndex =4
  79. HoverTint =40.0
  80. PressedThemeColorIndex =4
  81. PressedShade =75.0
  82. HoverForeThemeColorIndex =0
  83. HoverForeTint =75.0
  84. PressedForeThemeColorIndex =0
  85. PressedForeTint =75.0
  86. End
  87. Begin CheckBox
  88. BorderLineStyle =0
  89. LabelX =230
  90. LabelY =-30
  91. BorderThemeColorIndex =1
  92. BorderShade =65.0
  93. GridlineThemeColorIndex =1
  94. GridlineShade =65.0
  95. End
  96. Begin Subform
  97. BorderLineStyle =0
  98. Width =1701
  99. Height =1701
  100. BorderThemeColorIndex =1
  101. GridlineThemeColorIndex =1
  102. GridlineShade =65.0
  103. BorderShade =65.0
  104. ShowPageHeaderAndPageFooter =1
  105. End
  106. Begin FormHeader
  107. Height =5986
  108. BackColor =13611711
  109. Name ="EntêteFormulaire"
  110. AlternateBackThemeColorIndex =1
  111. AlternateBackShade =95.0
  112. Begin
  113. Begin Label
  114. OverlapFlags =85
  115. TextAlign =2
  116. Left =850
  117. Top =170
  118. Width =3232
  119. Height =340
  120. FontSize =13
  121. FontWeight =700
  122. BorderColor =8355711
  123. Name ="Étiquette0"
  124. Caption ="Outils d'Administration"
  125. GridlineColor =10921638
  126. LayoutCachedLeft =850
  127. LayoutCachedTop =170
  128. LayoutCachedWidth =4082
  129. LayoutCachedHeight =510
  130. ForeTint =100.0
  131. End
  132. Begin CommandButton
  133. OverlapFlags =85
  134. Left =283
  135. Top =170
  136. Width =501
  137. Height =336
  138. ForeColor =4210752
  139. Name ="Commande1"
  140. Caption ="Commande1"
  141. ControlTipText ="Fermer formulaire"
  142. GridlineColor =10921638
  143. OnClickEmMacro = Begin
  144. Version =196611
  145. ColumnsShown =8
  146. Begin
  147. Action ="Close"
  148. Argument ="-1"
  149. Argument =""
  150. Argument ="0"
  151. End
  152. Begin
  153. Comment ="_AXL:<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\015\012<UserI"
  154. "nterfaceMacro For=\"Commande1\" xmlns=\"http://schemas.microsoft.com/office/acce"
  155. "ssservices/2009/11/application\" xmlns:a=\"http://schemas.microsoft.com/office/a"
  156. "ccessservices/2009/11/forms\"><"
  157. End
  158. Begin
  159. Comment ="_AXL:Statements><Action Name=\"CloseWindow\"/></Statements></UserInterfaceMacro>"
  160. End
  161. End
  162. ImageData = Begin
  163. 0x2800000010000000100000000100200000000000000000000000000000000000 ,
  164. 0x0000000000000000000000000000000000000000000000000000000010081080 ,
  165. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  166. 0x000000000000000000000000000000000000000040485020100810e0104050ff ,
  167. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  168. 0x0000000000000000000000000000000040404080405860ff106890ff2080a0f0 ,
  169. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  170. 0x0000000000000000607070ff80a0b0ff4080a0ff20a0d0ff40a8e0ff2078a0ff ,
  171. 0x101020ff101020ff000000000000000000000000000000000000000000000000 ,
  172. 0x0000000000000000708890ffa0d8f0ff60d0ffff50c0f0ff30a8e0ff1080b0ff ,
  173. 0xe0d8d0ff102020ff000000000000000000000000000000000000000000000000 ,
  174. 0x0000000000000000708890ffb0e8f0ff80e0ffff60c8f0ff50b8f0ff1088c0ff ,
  175. 0xf0d8d0ff202830ff000000000000000090482030904820ff0000000000000000 ,
  176. 0x0000000000000000808890ffb0e8f0ff80e0ffff60d0ffff404050ff1090c0ff ,
  177. 0xf0e0d0ff303840ff0000000090482030a05030ffa05020ff0000000000000000 ,
  178. 0x00000000000000008090a0ffc0f0ffff90e0ffff70d8ffff60c8f0ff0090c0ff ,
  179. 0xf0e0e0ff404050ff90482030a05030ffd07840ffb05830ffa05020ffa04820ff ,
  180. 0x904820ff904820ff8090a0ffc0f0ffffa0e8ffff80d8ffff70d0f0ff40b0e0ff ,
  181. 0xf0e8e0ff605050ffa05830ffe08860fff09060fff08850ffe07850ffd07040ff ,
  182. 0xb06840ff904820ff8098a0ffc0f0ffffa0e8ffff90e8ffff80e0ffff80b8d0ff ,
  183. 0xf0e8e0ffe09870ffffc0a0ffffb090ffffa070fff09060fff08850ffe07850ff ,
  184. 0xd07040ffa05020ff8098a0ffc0f0ffffc0f8ffffa0e0f0ff90a8b0ffc0c8d0ff ,
  185. 0xf0f0e0ff908080fff0a070ffffc0a0ffffb090ffffb090ffffa880fff0a080ff ,
  186. 0xe09870ffb05030ff90a0a0ffe0f8ffffb0c8d0ff90a0b0fff0f0f0fffff8f0ff ,
  187. 0xf0f0f0ff607080ffe0987050f0a070ffffc0a0ffd06830ffe09870ffe09060ff ,
  188. 0xe08860ffe08050ff90a0b0ff90a8b0ffc0c8d0ffffffffffffffffffffffffff ,
  189. 0xffffffff708890ff00000000e0987050e09870ffd07040ff0000000000000000 ,
  190. 0x000000000000000090a0b0ff90a0b0ff90a0b0ff90a0b0ff90a0a0ff8098a0ff ,
  191. 0x8098a0ff9098a0ff0000000000000000e0987050e09870ff0000000000000000 ,
  192. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  193. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  194. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  195. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  196. 0x0000000000000000
  197. End
  198. LayoutCachedLeft =283
  199. LayoutCachedTop =170
  200. LayoutCachedWidth =784
  201. LayoutCachedHeight =506
  202. Gradient =0
  203. BackColor =16183539
  204. BackThemeColorIndex =-1
  205. BackTint =100.0
  206. BorderColor =12029087
  207. BorderThemeColorIndex =-1
  208. BorderTint =100.0
  209. HoverColor =15060409
  210. PressedColor =9592887
  211. HoverForeColor =4210752
  212. PressedForeColor =4210752
  213. WebImagePaddingLeft =2
  214. WebImagePaddingTop =2
  215. WebImagePaddingRight =1
  216. WebImagePaddingBottom =1
  217. Overlaps =1
  218. End
  219. Begin CheckBox
  220. OverlapFlags =85
  221. Left =283
  222. Top =3039
  223. Width =340
  224. Height =283
  225. ColumnOrder =0
  226. TabIndex =1
  227. BorderColor =10921638
  228. Name ="AvertSQL"
  229. AfterUpdate ="[Event Procedure]"
  230. OnClick ="[Event Procedure]"
  231. GridlineColor =10921638
  232. LayoutCachedLeft =283
  233. LayoutCachedTop =3039
  234. LayoutCachedWidth =623
  235. LayoutCachedHeight =3322
  236. Begin
  237. Begin Label
  238. OverlapFlags =247
  239. Left =512
  240. Top =3004
  241. Width =4245
  242. Height =555
  243. BorderColor =8355711
  244. Name ="Étiquette3"
  245. Caption ="Activer / Désactiver les avertissements SQL (lors de mises à jour, suppressions."
  246. "..)"
  247. GridlineColor =10921638
  248. LayoutCachedLeft =512
  249. LayoutCachedTop =3004
  250. LayoutCachedWidth =4757
  251. LayoutCachedHeight =3559
  252. ForeTint =100.0
  253. End
  254. End
  255. End
  256. Begin CommandButton
  257. OverlapFlags =85
  258. Left =510
  259. Top =793
  260. Width =4245
  261. Height =397
  262. TabIndex =2
  263. ForeColor =16777215
  264. Name ="Commande4"
  265. Caption ="Ouvrir les paramètres utilisateurs"
  266. OnClick ="[Event Procedure]"
  267. LeftPadding =90
  268. TopPadding =45
  269. RightPadding =105
  270. BottomPadding =150
  271. GridlineColor =10921638
  272. LayoutCachedLeft =510
  273. LayoutCachedTop =793
  274. LayoutCachedWidth =4755
  275. LayoutCachedHeight =1190
  276. ForeThemeColorIndex =1
  277. ForeTint =100.0
  278. Gradient =25
  279. BackColor =10642560
  280. BackThemeColorIndex =7
  281. BackTint =100.0
  282. BorderColor =10642560
  283. BorderThemeColorIndex =7
  284. BorderTint =100.0
  285. HoverColor =11895705
  286. HoverThemeColorIndex =7
  287. HoverTint =80.0
  288. PressedColor =8605542
  289. PressedThemeColorIndex =7
  290. PressedShade =80.0
  291. HoverForeThemeColorIndex =1
  292. HoverForeTint =100.0
  293. PressedForeThemeColorIndex =1
  294. PressedForeTint =100.0
  295. Shadow =-1
  296. QuickStyle =33
  297. QuickStyleMask =-1
  298. WebImagePaddingLeft =2
  299. WebImagePaddingTop =2
  300. WebImagePaddingRight =2
  301. WebImagePaddingBottom =2
  302. Overlaps =1
  303. End
  304. Begin CommandButton
  305. OverlapFlags =85
  306. Left =510
  307. Top =1586
  308. Width =4245
  309. Height =397
  310. TabIndex =3
  311. ForeColor =16777215
  312. Name ="Commande5"
  313. Caption ="Droits d'accès"
  314. OnClick ="[Event Procedure]"
  315. LeftPadding =60
  316. RightPadding =75
  317. BottomPadding =120
  318. GridlineColor =10921638
  319. LayoutCachedLeft =510
  320. LayoutCachedTop =1586
  321. LayoutCachedWidth =4755
  322. LayoutCachedHeight =1983
  323. ForeThemeColorIndex =1
  324. ForeTint =100.0
  325. Gradient =25
  326. BackColor =10642560
  327. BackThemeColorIndex =7
  328. BackTint =100.0
  329. BorderColor =10642560
  330. BorderThemeColorIndex =7
  331. BorderTint =100.0
  332. HoverColor =11895705
  333. HoverThemeColorIndex =7
  334. HoverTint =80.0
  335. PressedColor =8605542
  336. PressedThemeColorIndex =7
  337. PressedShade =80.0
  338. HoverForeThemeColorIndex =1
  339. HoverForeTint =100.0
  340. PressedForeThemeColorIndex =1
  341. PressedForeTint =100.0
  342. Shadow =-1
  343. QuickStyle =33
  344. QuickStyleMask =-1
  345. WebImagePaddingTop =1
  346. Overlaps =1
  347. End
  348. Begin CommandButton
  349. OverlapFlags =85
  350. Left =510
  351. Top =2323
  352. Width =4245
  353. Height =397
  354. TabIndex =4
  355. ForeColor =16777215
  356. Name ="Commande6"
  357. Caption ="Suivi des versions"
  358. OnClick ="[Event Procedure]"
  359. LeftPadding =60
  360. RightPadding =75
  361. BottomPadding =120
  362. GridlineColor =10921638
  363. LayoutCachedLeft =510
  364. LayoutCachedTop =2323
  365. LayoutCachedWidth =4755
  366. LayoutCachedHeight =2720
  367. ForeThemeColorIndex =1
  368. ForeTint =100.0
  369. Gradient =25
  370. BackColor =10642560
  371. BackThemeColorIndex =7
  372. BackTint =100.0
  373. BorderColor =10642560
  374. BorderThemeColorIndex =7
  375. BorderTint =100.0
  376. HoverColor =11895705
  377. HoverThemeColorIndex =7
  378. HoverTint =80.0
  379. PressedColor =8605542
  380. PressedThemeColorIndex =7
  381. PressedShade =80.0
  382. HoverForeThemeColorIndex =1
  383. HoverForeTint =100.0
  384. PressedForeThemeColorIndex =1
  385. PressedForeTint =100.0
  386. Shadow =-1
  387. QuickStyle =33
  388. QuickStyleMask =-1
  389. WebImagePaddingTop =1
  390. Overlaps =1
  391. End
  392. Begin CommandButton
  393. OverlapFlags =85
  394. Left =510
  395. Top =4422
  396. Width =4256
  397. Height =396
  398. TabIndex =5
  399. ForeColor =16777215
  400. Name ="ImportPDA"
  401. Caption ="Import Direct depuis PDA"
  402. OnClick ="[Event Procedure]"
  403. LeftPadding =60
  404. RightPadding =75
  405. BottomPadding =120
  406. GridlineColor =10921638
  407. LayoutCachedLeft =510
  408. LayoutCachedTop =4422
  409. LayoutCachedWidth =4766
  410. LayoutCachedHeight =4818
  411. ForeThemeColorIndex =1
  412. ForeTint =100.0
  413. Gradient =25
  414. BackColor =10642560
  415. BackThemeColorIndex =7
  416. BackTint =100.0
  417. BorderColor =10642560
  418. BorderThemeColorIndex =7
  419. BorderTint =100.0
  420. HoverColor =11895705
  421. HoverThemeColorIndex =7
  422. HoverTint =80.0
  423. PressedColor =8605542
  424. PressedThemeColorIndex =7
  425. PressedShade =80.0
  426. HoverForeThemeColorIndex =1
  427. HoverForeTint =100.0
  428. PressedForeThemeColorIndex =1
  429. PressedForeTint =100.0
  430. Shadow =-1
  431. QuickStyle =33
  432. QuickStyleMask =-1
  433. WebImagePaddingTop =1
  434. End
  435. Begin CommandButton
  436. OverlapFlags =85
  437. Left =510
  438. Top =3775
  439. Width =4245
  440. Height =397
  441. TabIndex =6
  442. ForeColor =16777215
  443. Name ="ToutImpr"
  444. Caption ="Tout Imprimer*"
  445. OnClick ="[Event Procedure]"
  446. LeftPadding =60
  447. RightPadding =75
  448. BottomPadding =120
  449. GridlineColor =10921638
  450. LayoutCachedLeft =510
  451. LayoutCachedTop =3775
  452. LayoutCachedWidth =4755
  453. LayoutCachedHeight =4172
  454. ForeThemeColorIndex =1
  455. ForeTint =100.0
  456. Gradient =25
  457. BackColor =10642560
  458. BackThemeColorIndex =7
  459. BackTint =100.0
  460. BorderColor =10642560
  461. BorderThemeColorIndex =7
  462. BorderTint =100.0
  463. HoverColor =11895705
  464. HoverThemeColorIndex =7
  465. HoverTint =80.0
  466. PressedColor =8605542
  467. PressedThemeColorIndex =7
  468. PressedShade =80.0
  469. HoverForeThemeColorIndex =1
  470. HoverForeTint =100.0
  471. PressedForeThemeColorIndex =1
  472. PressedForeTint =100.0
  473. Shadow =-1
  474. QuickStyle =33
  475. QuickStyleMask =-1
  476. WebImagePaddingTop =1
  477. End
  478. Begin CommandButton
  479. OverlapFlags =85
  480. Left =510
  481. Top =5106
  482. Width =4252
  483. Height =393
  484. TabIndex =7
  485. ForeColor =16777215
  486. Name ="PeripleToutExporter"
  487. Caption ="PERIPLE: Tout Exporter"
  488. OnClick ="[Event Procedure]"
  489. LeftPadding =60
  490. RightPadding =75
  491. BottomPadding =120
  492. GridlineColor =10921638
  493. LayoutCachedLeft =510
  494. LayoutCachedTop =5106
  495. LayoutCachedWidth =4762
  496. LayoutCachedHeight =5499
  497. ForeThemeColorIndex =1
  498. ForeTint =100.0
  499. Gradient =25
  500. BackColor =10642560
  501. BackThemeColorIndex =7
  502. BackTint =100.0
  503. BorderColor =10642560
  504. BorderThemeColorIndex =7
  505. BorderTint =100.0
  506. HoverColor =11895705
  507. HoverThemeColorIndex =7
  508. HoverTint =80.0
  509. PressedColor =8605542
  510. PressedThemeColorIndex =7
  511. PressedShade =80.0
  512. HoverForeThemeColorIndex =1
  513. HoverForeTint =100.0
  514. PressedForeThemeColorIndex =1
  515. PressedForeTint =100.0
  516. Shadow =-1
  517. QuickStyle =33
  518. QuickStyleMask =-1
  519. WebImagePaddingTop =1
  520. End
  521. Begin Label
  522. Visible = NotDefault
  523. OverlapFlags =85
  524. TextAlign =2
  525. Left =625
  526. Top =5703
  527. Width =3911
  528. Height =283
  529. BorderColor =8355711
  530. Name ="txt_prog"
  531. Caption ="..."
  532. GridlineColor =10921638
  533. LayoutCachedLeft =625
  534. LayoutCachedTop =5703
  535. LayoutCachedWidth =4536
  536. LayoutCachedHeight =5986
  537. ForeTint =100.0
  538. End
  539. End
  540. End
  541. Begin Section
  542. Height =0
  543. BackColor =13611711
  544. Name ="Détail"
  545. AlternateBackColor =15921906
  546. AlternateBackThemeColorIndex =1
  547. AlternateBackShade =95.0
  548. End
  549. Begin FormFooter
  550. Height =396
  551. BackColor =13611711
  552. Name ="PiedFormulaire"
  553. AlternateBackThemeColorIndex =1
  554. AlternateBackShade =95.0
  555. Begin
  556. Begin Label
  557. FontItalic = NotDefault
  558. OverlapFlags =85
  559. Left =120
  560. Top =60
  561. Width =8775
  562. Height =285
  563. BorderColor =8355711
  564. Name ="Étiquette12"
  565. Caption ="* Imprime un exemplaire de chaque formulaire depuis le début de l'année pour l'a"
  566. "gent choisi."
  567. GridlineColor =10921638
  568. LayoutCachedLeft =120
  569. LayoutCachedTop =60
  570. LayoutCachedWidth =8895
  571. LayoutCachedHeight =345
  572. ForeTint =100.0
  573. End
  574. End
  575. End
  576. End
  577. End
  578. CodeBehindForm
  579. Attribute VB_GlobalNameSpace = False
  580. Attribute VB_Creatable = True
  581. Attribute VB_PredeclaredId = True
  582. Attribute VB_Exposed = False
  583. Option Compare Database
  584. Private Sub AvertSQL_AfterUpdate()
  585. If Me.AvertSQL = True Then
  586. Call MAJParametre("AvertSQL", 1)
  587. Else
  588. Call MAJParametre("AvertSQL", 0)
  589. End If
  590. Me.Refresh
  591. End Sub
  592. Private Sub Commande4_Click()
  593. DoCmd.OpenForm "frm_ParamUtil"
  594. End Sub
  595. Private Sub Commande5_Click()
  596. DoCmd.OpenForm "frm_acces"
  597. End Sub
  598. Private Sub Commande6_Click()
  599. DoCmd.OpenForm "frm_SuiviVersions"
  600. End Sub
  601. Private Sub Form_Current()
  602. If parametre("AvertSQL") = 1 Then
  603. Me.AvertSQL = True
  604. Else
  605. Me.AvertSQL = False
  606. End If
  607. End Sub
  608. Private Sub ImportPDA_Click()
  609. Dim fichier As String
  610. Dim rep As String
  611. Dim nomFichier As String
  612. Dim strMAJImportRH, sql, critere As String
  613. Dim DejaImporte As Integer
  614. Dim CodeAgent As String
  615. Dim moisRH, anneeRH As Integer
  616. Dim rs As DAO.Recordset
  617. DejaImporte = 0
  618. 'chercher le nom du fichier
  619. fichier = Nz(ChercherNomFichier(), "")
  620. If fichier = "" Then
  621. Exit Sub
  622. End If
  623. '''''''procédure d'import du xml'''''''
  624. 'vider la table d'importation rapport
  625. DoCmd.SetWarnings False
  626. DoCmd.RunSQL ("DELETE * FROM Rapport;")
  627. 'test si fichier déja importé
  628. nomFichier = ExtraitNomFichier(fichier)
  629. rep = ExtraitNomRep(fichier)
  630. Call MAJParametre("RepXML", rep)
  631. DoCmd.SetWarnings False
  632. If DCount("FichierXML", "tbl_ImportRH", "[FichierXML]='" & nomFichier & "'") > 0 Or DCount("FichierXML", "tbl_ImportRH", "[FichierXML]='" & Right(nomFichier, (Len(nomFichier) - 2)) & "'") > 0 Then
  633. If MsgBox("Attention, ce fichier semble avoir déja été importé. Le réimport supprimera toutes les anciennes données relatives à ce fichier. Voulez vous continuer?", vbYesNo) = vbNo Then Exit Sub
  634. DejaImporte = 1
  635. sql = "DELETE * FROM tbl_ImportRH WHERE [FichierXML]='" & nomFichier & "' OR [FichierXML]='" & Right(nomFichier, (Len(nomFichier) - 2)) & "';"
  636. DoCmd.RunSQL sql
  637. End If
  638. 'appeler la procédure d'import XML
  639. Call ImportXMLPDA(fichier)
  640. strShortFileName = nomFichier
  641. 'TRANSFERT DES DONNEES RH VERS tbl_ImportRH (reprendre le code SQL du module d'import PDA)
  642. strUpdateImportRH = "INSERT INTO tbl_ImportRH ( CodeLigne, CodeAgent, DateRH, CodeChantier, CodeLocalisation, Localisation, strCategorieInterventionId, HeureSup1, HeureSup2, HeureSupDimanche, Repas, DistanceTranche1, VehiculePersoTranche1, DistanceTranche2, VehiculePersoTranche2, Remarque, Depart, FichierXML, DateImport, ResponsableImport ) " & _
  643. "SELECT Rapport.Id, Rapport.CodeAgent, ReformateDate([datedebut]) AS DDebut, Rapport.CodeChantier, Rapport.CodeLocalisation, DLookUp('strTiersMnemo','tblTiers','lngTiersId = ' & [CodeLocalisation]& ' ') AS Localisation, " & _
  644. "Rapport.CodeNatureRealisation, Rapport.HeureSup1, Rapport.HeureSup2, Rapport.HeureSupDimanche, Rapport.Repas, Rapport.DistanceTranche1, Rapport.VehiculePersoTranche1, Rapport.DistanceTranche2, Rapport.VehiculePersoTranche2, Rapport.Remarque, Rapport.Depart, '" & strShortFileName & "' AS FichierXML, Now() AS DateImport, Environ('Username') AS ResponsableImport " & _
  645. "FROM Rapport " & _
  646. "WHERE (((Rapport.HeureSup1) Is Not Null) AND ((Rapport.HeureSup2) Is Not Null) AND ((Rapport.HeureSupDimanche) Is Not Null) AND ((Rapport.Repas) Is Not Null) AND ((Rapport.DistanceTranche1) Is Not Null) AND ((Rapport.VehiculePersoTranche1) Is Not Null) AND ((Rapport.DistanceTranche2) Is Not Null) AND ((Rapport.VehiculePersoTranche2) Is Not Null));"
  647. DoCmd.RunSQL strUpdateImportRH
  648. Set rs = CurrentDb.OpenRecordset("SELECT * FROM tbl_ImportRH WHERE [FichierXML]='" & nomFichier & "';")
  649. If rs.RecordCount = 0 Then
  650. MsgBox "Données importées dans tbl_ImportRH; Erreur dans le retraitement des données, veuillez procéder manuellement."
  651. Exit Sub
  652. End If
  653. rs.MoveFirst
  654. CodeAgent = rs![CodeAgent]
  655. moisRH = Month(rs![DateRH])
  656. anneeRH = Year(rs![DateRH])
  657. If CodeAgent = "" Or Not anneeRH > 2000 Or Not moisRH <= 12 Or Not moisRH > 0 Then
  658. MsgBox "Données importées dans tbl_ImportRH; Erreur dans le retraitement des données, veuillez procéder manuellement."
  659. Exit Sub
  660. End If
  661. critere = "[CodeAgent]='" & CodeAgent & "' AND [MoisRH]=" & moisRH & " AND [AnneeRH]=" & anneeRH
  662. 'on supprime la ligne correspondante de la table tbl_suivi, puis on lance le form "frm_chargement"
  663. sql = "DELETE * FROM tbl_SuiviRH WHERE " & critere & ";"
  664. DoCmd.RunSQL sql
  665. DoCmd.SetWarnings True
  666. Call Chargement
  667. End Sub
  668. Private Sub PeripleToutExporter_Click()
  669. Dim moisRH, anneeRH, essai As Integer
  670. Dim sql As String
  671. Dim rs As DAO.Recordset
  672. If Not CurrentProject.AllForms("frm_menu").IsLoaded Then
  673. MsgBox "Le formulaire menu doit être ouvert"
  674. GoTo fin
  675. End If
  676. moisRH = forms![frm_menu].moisRH
  677. anneeRH = forms![frm_menu].anneeRH
  678. If MsgBox("Vous aller exporter vers le serveur Sharepoint les données de tous les agents pour la période suivante:" & _
  679. vbNewLine & moisRH & "\" & anneeRH, vbOKCancel) = vbCancel Then
  680. MsgBox "Opération annulée"
  681. GoTo fin
  682. End If
  683. DoCmd.Hourglass True
  684. 'test connexion sharepoint:
  685. essai = 0
  686. While testConnexionLecteur(lecteurVirtuel, repHttp) = False
  687. Call Attendre(500)
  688. essai = essai + 1
  689. If essai >= 3 Then
  690. MsgBox "Erreur: impossible de se connecter au serveur sharepoint, les fichiers seront créés ici: " & vbNewLine & _
  691. rep & nomFichier
  692. End If
  693. Wend
  694. sql = "SELECT tbl_Agents.CodeAgent, tbl_Agents.Nom " & _
  695. "From tbl_Agents " & _
  696. "GROUP BY tbl_Agents.CodeAgent, tbl_Agents.Nom, tbl_Agents.[CodeAgent] " & _
  697. "HAVING (((tbl_Agents.[CodeAgent]) In (SELECT [CodeAgent] FROM tbl_ImportRH WHERE Month([DateRH])=" & moisRH & " AND Year([DateRH])=" & anneeRH & ";))) " & _
  698. "ORDER BY tbl_Agents.Nom;"
  699. 'Debug.Print sql
  700. Set rs = CurrentDb.OpenRecordset(sql)
  701. Me.txt_prog.Visible = True
  702. If Not rs.RecordCount > 0 Then
  703. MsgBox "Erreur: aucune donnée à exporter pour cette période"
  704. GoTo fin
  705. End If
  706. rs.MoveLast
  707. rs.MoveFirst
  708. Do Until rs.EOF = True
  709. Me.txt_prog.Caption = rs.AbsolutePosition & "/" & rs.RecordCount
  710. If VerifDonneesExport(rs![CodeAgent], moisRH, anneeRH) = True Then
  711. Call Periple_MajTableTampon(rs![CodeAgent], moisRH, anneeRH, True)
  712. 'Call Periple_ExportXML(True)
  713. Else
  714. MsgBox rs![Nom] & " - Vous devez corriger les erreurs détectées dans les données pour pouvoir les exporter."
  715. End If
  716. rs.MoveNext
  717. Loop
  718. fin:
  719. On Error GoTo 0
  720. DoCmd.Hourglass False
  721. Me.txt_prog.Visible = False
  722. Set rs = Nothing
  723. Exit Sub
  724. err:
  725. MsgBox "Erreur: " & err.Description
  726. GoTo fin
  727. End Sub
  728. Private Sub ToutImpr_Click()
  729. Dim CodeAgent, msg, critere, imprimante As String
  730. Dim rs As DAO.Recordset
  731. CodeAgent = Nz(InputBox("Code de l'agent?"), "")
  732. If Not Len(CodeAgent) > 0 Then Exit Sub
  733. If IsNull(DLookup("CodeAgent", "tbl_Agents", "[CodeAgent]='" & CodeAgent & "'")) Then
  734. MsgBox ("Code non trouvé dans tbl_Agents")
  735. Exit Sub
  736. End If
  737. Set rs = CurrentDb.OpenRecordset("SELECT * FROM tbl_SuiviRH WHERE [AnneeRH]=" & Year(Now()) & " AND [CodeAgent]='" & CodeAgent & "' ORDER BY [moisRH];")
  738. If Not rs.RecordCount > 0 Then
  739. MsgBox ("Pas de données trouvées pour l'année en cours")
  740. Exit Sub
  741. End If
  742. rs.MoveFirst
  743. Do Until rs.EOF = True
  744. msg = msg & "," & MonthName(rs![moisRH])
  745. rs.MoveNext
  746. Loop
  747. msg = "Vous allez imprimer les formulaires des mois suivants: " & vbNewLine & Right(msg, Len(msg) - 1)
  748. If MsgBox(msg, vbYesNo) = vbNo Then Exit Sub
  749. 'selection de l'imprimante utilisateur (cf. tbl_ParamUtil)
  750. imprimante = Nz(DLookup("valeur", "tbl_ParamUtil", "[parametre]='imprimante' AND [user]='" & CurrentUser & "'"), "")
  751. If imprimante = "" Then
  752. MsgBox "Pas d'imprimante définie pour cet utilisateur (cf. tbl_parametre)"
  753. Exit Sub
  754. End If
  755. NumIMP = 0
  756. NombreImp = Application.Printers.Count
  757. For Each ImpCherche In Application.Printers
  758. If ImpCherche.DeviceName = imprimante Then
  759. Set Application.Printer = Application.Printers(NumIMP)
  760. Exit For
  761. Else
  762. NumIMP = NumIMP + 1
  763. End If
  764. Next ImpCherche
  765. rs.MoveFirst
  766. Do Until rs.EOF = True
  767. critere = "[CodeAgent]='" & CodeAgent & "' AND [MoisRH]=" & rs![moisRH] & " AND [AnneeRH]=" & rs![anneeRH]
  768. Call ImprEtats("Et_FormDep", 1, critere)
  769. Call ImprEtats("Et_FormHS", 1, critere)
  770. Call ImprEtats("Et_RecapEFD", 1, critere)
  771. Call ImprEtats("Et_EtFraisDep", 1, critere)
  772. rs.MoveNext
  773. Loop
  774. Set Application.Printer = Nothing
  775. End Sub