frm_lstBaremes.bas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. Version =20
  2. VersionRequired =20
  3. Begin Form
  4. DividingLines = NotDefault
  5. AllowDesignChanges = NotDefault
  6. RecordLocks =1
  7. PictureAlignment =2
  8. DatasheetGridlinesBehavior =3
  9. GridY =10
  10. Width =15193
  11. DatasheetFontHeight =11
  12. ItemSuffix =33
  13. Right =10725
  14. Bottom =12345
  15. DatasheetGridlinesColor =14806254
  16. RecSrcDt = Begin
  17. 0x89b1c2c135d1e440
  18. End
  19. RecordSource ="SELECT tbl_baremes.NomBareme, tbl_baremes.Commentaire, Max(tbl_PeriodeBareme.Dat"
  20. "eInf) AS MaxDeDateInf FROM tbl_baremes INNER JOIN tbl_PeriodeBareme ON (tbl_bare"
  21. "mes.PeriodeValidite = tbl_PeriodeBareme.CodePeriode) AND (tbl_baremes.NomBareme "
  22. "= tbl_PeriodeBareme.NomBareme) GROUP BY tbl_baremes.NomBareme, tbl_baremes.Comme"
  23. "ntaire; "
  24. OnCurrent ="[Event Procedure]"
  25. OnOpen ="[Event Procedure]"
  26. DatasheetFontName ="Calibri"
  27. PrtMip = Begin
  28. 0x6801000068010000680100006801000000000000201c0000e010000001000000 ,
  29. 0x010000006801000000000000a10700000100000001000000
  30. End
  31. FilterOnLoad =0
  32. ShowPageMargins =0
  33. DisplayOnSharePointSite =1
  34. DatasheetAlternateBackColor =15921906
  35. DatasheetGridlinesColor12 =0
  36. FitToScreen =1
  37. DatasheetBackThemeColorIndex =1
  38. BorderThemeColorIndex =3
  39. ThemeFontIndex =1
  40. ForeThemeColorIndex =0
  41. AlternateBackThemeColorIndex =1
  42. AlternateBackShade =95.0
  43. Begin
  44. Begin Label
  45. BackStyle =0
  46. FontSize =11
  47. FontName ="Calibri"
  48. ThemeFontIndex =1
  49. BackThemeColorIndex =1
  50. BorderThemeColorIndex =0
  51. BorderTint =50.0
  52. ForeThemeColorIndex =0
  53. ForeTint =50.0
  54. GridlineThemeColorIndex =1
  55. GridlineShade =65.0
  56. End
  57. Begin CommandButton
  58. Width =1701
  59. Height =283
  60. FontSize =11
  61. FontWeight =400
  62. FontName ="Calibri"
  63. ForeThemeColorIndex =0
  64. ForeTint =75.0
  65. GridlineThemeColorIndex =1
  66. GridlineShade =65.0
  67. UseTheme =1
  68. Shape =1
  69. Gradient =12
  70. BackThemeColorIndex =4
  71. BackTint =60.0
  72. BorderLineStyle =0
  73. BorderColor =16777215
  74. BorderThemeColorIndex =4
  75. BorderTint =60.0
  76. ThemeFontIndex =1
  77. HoverThemeColorIndex =4
  78. HoverTint =40.0
  79. PressedThemeColorIndex =4
  80. PressedShade =75.0
  81. HoverForeThemeColorIndex =0
  82. HoverForeTint =75.0
  83. PressedForeThemeColorIndex =0
  84. PressedForeTint =75.0
  85. End
  86. Begin TextBox
  87. AddColon = NotDefault
  88. FELineBreak = NotDefault
  89. BorderLineStyle =0
  90. Width =1701
  91. LabelX =-1701
  92. FontSize =11
  93. FontName ="Calibri"
  94. AsianLineBreak =1
  95. BackThemeColorIndex =1
  96. BorderThemeColorIndex =1
  97. BorderShade =65.0
  98. ThemeFontIndex =1
  99. ForeThemeColorIndex =0
  100. ForeTint =75.0
  101. GridlineThemeColorIndex =1
  102. GridlineShade =65.0
  103. End
  104. Begin ComboBox
  105. AddColon = NotDefault
  106. BorderLineStyle =0
  107. Width =1701
  108. LabelX =-1701
  109. FontSize =11
  110. FontName ="Calibri"
  111. AllowValueListEdits =1
  112. InheritValueList =1
  113. ThemeFontIndex =1
  114. BackThemeColorIndex =1
  115. BorderThemeColorIndex =1
  116. BorderShade =65.0
  117. ForeThemeColorIndex =2
  118. ForeShade =50.0
  119. GridlineThemeColorIndex =1
  120. GridlineShade =65.0
  121. End
  122. Begin Subform
  123. BorderLineStyle =0
  124. Width =1701
  125. Height =1701
  126. BorderThemeColorIndex =1
  127. GridlineThemeColorIndex =1
  128. GridlineShade =65.0
  129. BorderShade =65.0
  130. ShowPageHeaderAndPageFooter =1
  131. End
  132. Begin FormHeader
  133. Height =1133
  134. BackColor =12566463
  135. Name ="EntêteFormulaire"
  136. AlternateBackThemeColorIndex =1
  137. AlternateBackShade =95.0
  138. Begin
  139. Begin Label
  140. OverlapFlags =85
  141. Left =566
  142. Top =793
  143. Width =1245
  144. Height =315
  145. BorderColor =8355711
  146. Name ="Étiquette0"
  147. Caption ="NomBareme"
  148. GridlineColor =10921638
  149. LayoutCachedLeft =566
  150. LayoutCachedTop =793
  151. LayoutCachedWidth =1811
  152. LayoutCachedHeight =1108
  153. ForeTint =100.0
  154. End
  155. Begin Label
  156. OverlapFlags =85
  157. Left =3231
  158. Top =793
  159. Width =2820
  160. Height =315
  161. BorderColor =8355711
  162. Name ="Étiquette6"
  163. Caption ="Commentaire"
  164. GridlineColor =10921638
  165. LayoutCachedLeft =3231
  166. LayoutCachedTop =793
  167. LayoutCachedWidth =6051
  168. LayoutCachedHeight =1108
  169. ForeTint =100.0
  170. End
  171. Begin Label
  172. OverlapFlags =85
  173. Left =680
  174. Top =56
  175. Width =3986
  176. Height =334
  177. FontSize =13
  178. BorderColor =8355711
  179. Name ="Étiquette7"
  180. Caption ="Gestion des barèmes"
  181. GridlineColor =10921638
  182. LayoutCachedLeft =680
  183. LayoutCachedTop =56
  184. LayoutCachedWidth =4666
  185. LayoutCachedHeight =390
  186. ForeTint =100.0
  187. End
  188. Begin CommandButton
  189. OverlapFlags =85
  190. Left =56
  191. Top =56
  192. Width =576
  193. Height =351
  194. ForeColor =4210752
  195. Name ="Commande16"
  196. Caption ="Commande16"
  197. ControlTipText ="Fermer formulaire"
  198. GridlineColor =10921638
  199. OnClickEmMacro = Begin
  200. Version =196611
  201. ColumnsShown =8
  202. Begin
  203. Action ="Close"
  204. Argument ="-1"
  205. Argument =""
  206. Argument ="0"
  207. End
  208. Begin
  209. Comment ="_AXL:<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\015\012<UserI"
  210. "nterfaceMacro For=\"Commande16\" xmlns=\"http://schemas.microsoft.com/office/acc"
  211. "essservices/2009/11/application\" xmlns:a=\"http://schemas.microsoft.com/office/"
  212. "accessservices/2009/11/forms\">"
  213. End
  214. Begin
  215. Comment ="_AXL:<Statements><Action Name=\"CloseWindow\"/></Statements></UserInterfaceMacro"
  216. ">"
  217. End
  218. End
  219. ImageData = Begin
  220. 0x2800000010000000100000000100200000000000000000000000000000000000 ,
  221. 0x0000000000000000000000000000000000000000000000000000000010081080 ,
  222. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  223. 0x000000000000000000000000000000000000000040485020100810e0104050ff ,
  224. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  225. 0x0000000000000000000000000000000040404080405860ff106890ff2080a0f0 ,
  226. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  227. 0x0000000000000000607070ff80a0b0ff4080a0ff20a0d0ff40a8e0ff2078a0ff ,
  228. 0x101020ff101020ff000000000000000000000000000000000000000000000000 ,
  229. 0x0000000000000000708890ffa0d8f0ff60d0ffff50c0f0ff30a8e0ff1080b0ff ,
  230. 0xe0d8d0ff102020ff000000000000000000000000000000000000000000000000 ,
  231. 0x0000000000000000708890ffb0e8f0ff80e0ffff60c8f0ff50b8f0ff1088c0ff ,
  232. 0xf0d8d0ff202830ff000000000000000090482030904820ff0000000000000000 ,
  233. 0x0000000000000000808890ffb0e8f0ff80e0ffff60d0ffff404050ff1090c0ff ,
  234. 0xf0e0d0ff303840ff0000000090482030a05030ffa05020ff0000000000000000 ,
  235. 0x00000000000000008090a0ffc0f0ffff90e0ffff70d8ffff60c8f0ff0090c0ff ,
  236. 0xf0e0e0ff404050ff90482030a05030ffd07840ffb05830ffa05020ffa04820ff ,
  237. 0x904820ff904820ff8090a0ffc0f0ffffa0e8ffff80d8ffff70d0f0ff40b0e0ff ,
  238. 0xf0e8e0ff605050ffa05830ffe08860fff09060fff08850ffe07850ffd07040ff ,
  239. 0xb06840ff904820ff8098a0ffc0f0ffffa0e8ffff90e8ffff80e0ffff80b8d0ff ,
  240. 0xf0e8e0ffe09870ffffc0a0ffffb090ffffa070fff09060fff08850ffe07850ff ,
  241. 0xd07040ffa05020ff8098a0ffc0f0ffffc0f8ffffa0e0f0ff90a8b0ffc0c8d0ff ,
  242. 0xf0f0e0ff908080fff0a070ffffc0a0ffffb090ffffb090ffffa880fff0a080ff ,
  243. 0xe09870ffb05030ff90a0a0ffe0f8ffffb0c8d0ff90a0b0fff0f0f0fffff8f0ff ,
  244. 0xf0f0f0ff607080ffe0987050f0a070ffffc0a0ffd06830ffe09870ffe09060ff ,
  245. 0xe08860ffe08050ff90a0b0ff90a8b0ffc0c8d0ffffffffffffffffffffffffff ,
  246. 0xffffffff708890ff00000000e0987050e09870ffd07040ff0000000000000000 ,
  247. 0x000000000000000090a0b0ff90a0b0ff90a0b0ff90a0b0ff90a0a0ff8098a0ff ,
  248. 0x8098a0ff9098a0ff0000000000000000e0987050e09870ff0000000000000000 ,
  249. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  250. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  251. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  252. 0x0000000000000000000000000000000000000000000000000000000000000000 ,
  253. 0x0000000000000000
  254. End
  255. LayoutCachedLeft =56
  256. LayoutCachedTop =56
  257. LayoutCachedWidth =632
  258. LayoutCachedHeight =407
  259. Gradient =0
  260. BackColor =14277081
  261. BackThemeColorIndex =1
  262. BackTint =100.0
  263. BackShade =85.0
  264. BorderColor =14136213
  265. HoverColor =15060409
  266. PressedColor =9592887
  267. HoverForeColor =4210752
  268. PressedForeColor =4210752
  269. WebImagePaddingLeft =2
  270. WebImagePaddingTop =2
  271. WebImagePaddingRight =1
  272. WebImagePaddingBottom =1
  273. End
  274. Begin Label
  275. OverlapFlags =85
  276. Left =6525
  277. Top =795
  278. Width =1575
  279. Height =315
  280. BorderColor =8355711
  281. Name ="Étiquette20"
  282. Caption ="Valide depuis le"
  283. GridlineColor =10921638
  284. LayoutCachedLeft =6525
  285. LayoutCachedTop =795
  286. LayoutCachedWidth =8100
  287. LayoutCachedHeight =1110
  288. ForeTint =100.0
  289. End
  290. End
  291. End
  292. Begin Section
  293. CanGrow = NotDefault
  294. CanShrink = NotDefault
  295. Height =453
  296. BackColor =14211288
  297. Name ="Détail"
  298. AlternateBackColor =15921906
  299. AlternateBackThemeColorIndex =1
  300. AlternateBackShade =95.0
  301. Begin
  302. Begin TextBox
  303. OverlapFlags =85
  304. BackStyle =0
  305. IMESentenceMode =3
  306. Left =566
  307. Top =56
  308. Width =2556
  309. Height =315
  310. ColumnWidth =2790
  311. BorderColor =10921638
  312. ForeColor =4210752
  313. Name ="NomBareme"
  314. ControlSource ="NomBareme"
  315. GridlineColor =10921638
  316. LayoutCachedLeft =566
  317. LayoutCachedTop =56
  318. LayoutCachedWidth =3122
  319. LayoutCachedHeight =371
  320. End
  321. Begin TextBox
  322. OverlapFlags =85
  323. BackStyle =0
  324. IMESentenceMode =3
  325. Left =3231
  326. Top =56
  327. Width =3171
  328. Height =315
  329. ColumnWidth =2775
  330. TabIndex =1
  331. BorderColor =10921638
  332. ForeColor =4210752
  333. Name ="Commentaire"
  334. ControlSource ="Commentaire"
  335. GridlineColor =10921638
  336. LayoutCachedLeft =3231
  337. LayoutCachedTop =56
  338. LayoutCachedWidth =6402
  339. LayoutCachedHeight =371
  340. End
  341. Begin TextBox
  342. OverlapFlags =85
  343. BackStyle =0
  344. IMESentenceMode =3
  345. Left =6519
  346. Top =56
  347. Height =315
  348. TabIndex =2
  349. BorderColor =10921638
  350. ForeColor =4210752
  351. Name ="DateInf"
  352. ControlSource ="MaxDeDateInf"
  353. GridlineColor =10921638
  354. LayoutCachedLeft =6519
  355. LayoutCachedTop =56
  356. LayoutCachedWidth =8220
  357. LayoutCachedHeight =371
  358. End
  359. Begin CommandButton
  360. OverlapFlags =85
  361. Left =8447
  362. Top =56
  363. Width =2494
  364. Height =340
  365. TabIndex =3
  366. ForeColor =4210752
  367. Name ="Commande29"
  368. Caption ="Historique des versions"
  369. OnClick ="[Event Procedure]"
  370. GridlineColor =10921638
  371. LayoutCachedLeft =8447
  372. LayoutCachedTop =56
  373. LayoutCachedWidth =10941
  374. LayoutCachedHeight =396
  375. Gradient =0
  376. BackColor =15921906
  377. BackThemeColorIndex =1
  378. BackTint =100.0
  379. BackShade =95.0
  380. BorderColor =14136213
  381. HoverColor =15060409
  382. PressedColor =9592887
  383. HoverForeColor =4210752
  384. PressedForeColor =4210752
  385. WebImagePaddingLeft =2
  386. WebImagePaddingTop =2
  387. WebImagePaddingRight =1
  388. WebImagePaddingBottom =1
  389. End
  390. Begin CommandButton
  391. OverlapFlags =85
  392. Left =11168
  393. Top =56
  394. Width =2494
  395. Height =340
  396. TabIndex =4
  397. ForeColor =4210752
  398. Name ="cmdMAJ"
  399. Caption ="Mettre à jour"
  400. OnClick ="[Event Procedure]"
  401. GridlineColor =10921638
  402. LayoutCachedLeft =11168
  403. LayoutCachedTop =56
  404. LayoutCachedWidth =13662
  405. LayoutCachedHeight =396
  406. Gradient =0
  407. BackColor =15921906
  408. BackThemeColorIndex =1
  409. BackTint =100.0
  410. BackShade =95.0
  411. BorderColor =14136213
  412. HoverColor =15060409
  413. PressedColor =9592887
  414. HoverForeColor =4210752
  415. PressedForeColor =4210752
  416. WebImagePaddingLeft =2
  417. WebImagePaddingTop =2
  418. WebImagePaddingRight =1
  419. WebImagePaddingBottom =1
  420. End
  421. End
  422. End
  423. Begin FormFooter
  424. CanGrow = NotDefault
  425. CanShrink = NotDefault
  426. Height =2324
  427. BackColor =10855845
  428. Name ="PiedFormulaire"
  429. AlternateBackThemeColorIndex =1
  430. AlternateBackShade =95.0
  431. Begin
  432. Begin Subform
  433. CanGrow = NotDefault
  434. OverlapFlags =85
  435. BorderWidth =2
  436. Left =510
  437. Top =170
  438. Width =12075
  439. Height =1635
  440. BorderColor =16777215
  441. Name ="sfrm_detailbareme"
  442. SourceObject ="Form.sfrm_detailbareme"
  443. LinkChildFields ="NomBareme"
  444. LinkMasterFields ="NomBareme"
  445. GridlineColor =10921638
  446. LayoutCachedLeft =510
  447. LayoutCachedTop =170
  448. LayoutCachedWidth =12585
  449. LayoutCachedHeight =1805
  450. BorderShade =100.0
  451. End
  452. End
  453. End
  454. End
  455. End
  456. CodeBehindForm
  457. Attribute VB_GlobalNameSpace = False
  458. Attribute VB_Creatable = True
  459. Attribute VB_PredeclaredId = True
  460. Attribute VB_Exposed = False
  461. Option Compare Database
  462. Private Sub cmdMAJ_Click()
  463. Dim critere, NomBareme As String
  464. Dim periode As Integer
  465. NomBareme = Nz(Me.NomBareme, "")
  466. 'cherche la période la plus récente pour cet agent (attention au format des dates, les fonctions de domaine utilisent le format anglosaxon (mm/jj/aaaa)
  467. periode = Nz(DLookup("[CodePeriode]", "tbl_PeriodeBareme", "[NomBareme]='" & NomBareme & "' AND [DateInf]=#" & Format(DMax("[DateInf]", "tbl_PeriodeBareme", "[NomBareme]='" & NomBareme & "'"), "mm/dd/yyyy") & "#"), 0)
  468. If periode = 0 Then Exit Sub
  469. If NomBareme = "" Or periode = 0 Then Exit Sub
  470. critere = "[NomBareme]='" & NomBareme & "' AND [PeriodeValidite]=" & periode
  471. DoCmd.OpenForm "frm_MAJBareme", , , critere
  472. End Sub
  473. Private Sub Commande29_Click()
  474. Dim critere, NomBareme As String
  475. NomBareme = Nz(Me.NomBareme, "")
  476. critere = "[NomBareme]='" & NomBareme & "'"
  477. DoCmd.OpenForm "frm_HistoBaremes", , , critere
  478. End Sub
  479. Sub AffichageSfrm()
  480. Dim niv As Integer
  481. Dim hauteur As Double
  482. niv = 0
  483. If IsNull(Me![sfrm_detailbareme].Form.BorneInf) Then
  484. 'coeff simple
  485. niv = 1
  486. Else
  487. 'barême
  488. niv = 2
  489. End If
  490. Call VerrouSfrmDetailBareme(forms![frm_lstBaremes], niv)
  491. 'hauteur auto
  492. hauteur = Me.[sfrm_detailbareme].Form.EntêteFormulaire.Height _
  493. + Me.[sfrm_detailbareme].Form.PiedFormulaire.Height _
  494. + Me.[sfrm_detailbareme].Form.Détail.Height _
  495. * (Me.[sfrm_detailbareme].Form.RecordsetClone.RecordCount) _
  496. + 110
  497. Me.[sfrm_detailbareme].Form.InsideHeight = hauteur
  498. Me.[sfrm_detailbareme].Height = hauteur
  499. Me.Refresh
  500. End Sub
  501. Private Sub Form_Current()
  502. AffichageSfrm
  503. End Sub
  504. Private Sub Form_Open(Cancel As Integer)
  505. 'hauteur pied de form auto
  506. Dim compte As Integer
  507. Dim rst As DAO.Recordset
  508. Set rst = Me.RecordsetClone
  509. If rst.RecordCount = 0 Then Exit Sub
  510. rst.MoveLast
  511. compte = rst.RecordCount
  512. Me.PiedFormulaire.Height = Me.Form.InsideHeight - (Me.EntêteFormulaire.Height + compte * Me.Détail.Height)
  513. End Sub