IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBA Access Discussion :

Erreur dans le code VBA : formulaire non trouvé [AC-2010]


Sujet :

VBA Access

  1. #1
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut Erreur dans le code VBA : formulaire non trouvé
    Bonjour à tous,
    j’espère que je trouve ma réponde dans ce forum que je le trouve bien pour apprendre, premièrement merci pour tous qui aide les débutants à avoir plus d'expérience (comme moi lol ).
    j'ai un code qui fonctionne pas :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    Public Function maFonction2204Click()
    
    If Not Forms![Formulaire212ChangementMDP3]![Controle2202MDP] = Forms![Formulaire212ChangementMDP3]![Controle2205TexteCache1].Value Then
    MsgBox "Votre mot de passe est différent de celui donné à l'étape précédente. Vous devez entrer le même."
    Forms![Formulaire212ChangementMDP3]![Controle2202MDP] = Null
    
    Else
    
    DoCmd.SetWarnings False
    
    DoCmd.RunSQL " UPDATE Table06ComptesTechniciens SET MDP = '" & Forms![Formulaire212ChangementMDP3]![Controle2202MDP].[Value] & "' WHERE Table06ComptesTechniciens.N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1].Value & ";"
    
    DoCmd.SetWarnings True
    
    MsgBox "Votre mot de passe a été changé."
    
    DoCmd.Close acForm, "Formulaire212ChangementMDP3"
    
    End If
    
    End Function
    il bug et il m’écrit " access n'a pas trouvé le formulaire212.
    Merci d'avance pour votre aide.

  2. #2
    Membre émérite Avatar de Zekraoui_Jakani
    Homme Profil pro
    Inscrit en
    Novembre 2013
    Messages
    1 670
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Novembre 2013
    Messages : 1 670
    Points : 2 489
    Points
    2 489
    Par défaut Utilisation du mot de passe
    Je vous donne un exemple que j'exploite:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    Function confirmerMDP(pwd) As String
        'Noter le mot de passe donné par l'utilisateur (pwd)
        Pass = "'" & UCase(Trim(pwd)) & "'"
     
        Select Case Pass
            'Comparer le mot de passe donné par l'utilisateur à celui attendu (pWord)
            Case Is = "'" & UCase(Trim(Me.pWord)) & "'"
                Me.Refresh
                MyFilter = "[ID] = " & "'" & Me.ListEmployees & "'"
                Me.Filter = MyFilter
                Me.FilterOn = True
                MsgBox "Bonjour " & Me.Employé & " !", vbOKOnly, "Message d'accueil"
                confirmerMDP = Pass
                GoTo MAJautorisations
            Case Else
                monMsg = "Le mot de passe n'est pas correct !"
                monMsg = monMsg & vbLf & vbLf & "Veuillez réessayer ..."
                MsgBox monMsg, vbOKOnly, "Mot de passe incorrect !"
                Me.TxtPword = Null
                confirmerMDP = ""
        End Select
     
     
    MAJautorisations_exit:
    Exit Function
     
    MAJautorisations:
        'Faire ce qu'on veut ici pour continuer le traitement ...
        GoTo MAJautorisations_exit
     
    End Function

  3. #3
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Bonjour,

    Ce code est dans le formulaire mentionné ou dans un module extérieur ?

    Cordialement,
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  4. #4
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    Bonjour à tous,
    merci pour zekrawi, et aussi pour loufab, le code est dans un module extérieur.
    voici le module complet, il me signal des erreurs de non reconnaissance des formulaires dans la plupart des fonctions :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    Option Compare Database
     
    Public Function maFonction0102Click()
     
    DoCmd.OpenForm "Formulaire101Recherche"
     
    End Function
     
    Public Function maFonction0103Click()
     
    ''''''''''''''''''''DoCmd.OpenReport "Requête17", acViewReport, , , acWindowNormal
    ''''DoCmd.OpenQuery "Requete17Controle0103Tableau", acViewNormal, acReadOnly
    DoCmd.OpenForm "Formulaire301Requete17"
     
     
    End Function
     
    Public Function maFonction0104Click()
     
    DoCmd.OpenForm "Formulaire201Identification"
     
    End Function
     
     
    Public Function maFonction0105Click()
     
    Dim oRst As DAO.Recordset
    Dim FilePath As String
     
    Set oRst = CurrentDb.OpenRecordset("SELECT Table11DocumentsGlobaux.[document].FileData FROM Table11DocumentsGlobaux;")
     
            FilePath = Environ("Temp") & "\prevention et securite au laboratoire.pdf"
     
            If Not Dir(FilePath, vbHidden) <> "" Then
            oRst.Fields(0).SaveToFile FilePath
            Else
            Kill FilePath
            oRst.Fields(0).SaveToFile FilePath
            End If
     
             'nécessite d'activer reference Microsoft Shell Controls and Automation
        'dans la fenêtre VisualBasic Outils ->Rérences
        Dim objShell As Shell
        Set objShell = New Shell
        objShell.ShellExecute "prevention et securite au laboratoire.pdf", "", Environ("Temp"), "open", 1
     
    End Function
     
    Public Function maFonction0202Click()
     
    DoCmd.Close acForm, "Formulaire101Recherche"
     
    End Function
     
    Public Function maFonction0203AfterUpdate()
     
    Forms![Formulaire101Recherche]![Controle0205Liste].Requery
     
    End Function
     
    Public Function maFonction0204Click()
     
    Forms![Formulaire101Recherche]![Controle0205Liste].Requery
    Forms![Formulaire101Recherche]![Controle0207Description].Caption = "Description :"
     
    End Function
     
    Public Function maFonction0205Click()
     
    Forms![Formulaire101Recherche]![Controle0210TexteCache1].Value = Forms![Formulaire101Recherche]![Controle0205Liste].Column(0)
     
    ''''''''''''''''''''Forms![Formulaire101Recherche]![Requête2].Requery
    Forms![Formulaire101Recherche]![Controle0206SousForm].Requery
     
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT [CarPrincipales], Disponibilite FROM Table01Machines WHERE N° = " & Forms![Formulaire101Recherche]![Controle0210TexteCache1] & ";")
    r.MoveFirst
     
    Forms![Formulaire101Recherche]![Controle0207Description].Caption = "Description : " & r.Fields(0).Value
     
    Forms![Formulaire101Recherche]![Controle0208HS].Visible = False
     
     
    If r.Fields(1).Value = "indisponible" Then
    Forms![Formulaire101Recherche]![Controle0208HS].Caption = "Cette machine est indisponible."
    Forms![Formulaire101Recherche]![Controle0208HS].Visible = True
     
     
    End If
     
     
    End Function
     
    Public Function maFonction0209Click()
     
    If IsNull(Forms![Formulaire101Recherche]![Controle0210TexteCache1].Value) Then
     
    MsgBox "Vous devez d'abord choisir une machine."
     
    Else
     
    maFonctionPictogrammes
     
    Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] = Forms![Formulaire101Recherche]![Controle0210TexteCache1].[Value]
     
    '''
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT disponibilite FROM Table01Machines WHERE N° = " & Forms![Formulaire101Recherche]![Controle0210TexteCache1] & ";")
    r.MoveFirst
     
    Forms![Formulaire102FicheMachine]![Controle0304HS].Visible = False
    If r.Fields(0).Value = 3 Then
    Forms![Formulaire102FicheMachine]![Controle0304HS].Caption = "Cette machine est indisponible."
    Forms![Formulaire102FicheMachine]![Controle0304HS].Visible = True
    End If
    '''
     
    DoCmd.Close acForm, "Formulaire101Recherche"
     
    End If
     
    End Function
     
    Public Function maFonction0302Click()
     
    DoCmd.OpenForm "Formulaire101Recherche"
     
    DoCmd.Close acForm, "Formulaire102FicheMachine"
     
    End Function
     
    Public Function maFonction0306Click()
     
    DoCmd.OpenForm "Formulaire103DocAssocies"
     
    End Function
     
    Public Function maFonction0307Click()
     
    DoCmd.OpenForm "Formulaire104DocLogAssocie"
     
    End Function
     
    Public Function maFonction0308Click()
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N°, disponibilite FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] & ";")
    r.MoveFirst
     
    If r.Fields(0).Value = "indisponible" Then
    MsgBox "Cette machine n'est pas disponible, vous ne pouvez pas la réserver. Contactez le référent EC pour plus d'informations."
    Else
     
     
    Dim r0 As DAO.Recordset
    Set r0 = CurrentDb.OpenRecordset("SELECT Etat FROM Table12VariablesGlobales;")
    r0.MoveFirst
     
    If r0.Fields(0).Value = 1 Then
    MsgBox "Une réservation est en cours, veuillez réessayer dans quelques minutes."
    Else
     
    If r0.Fields(0).Value = 2 Then
    MsgBox "La base de donnée est en cours de traitement par un technicien, veuillez réessayer plus tard."
    Else
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 1 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "0"
     
    maFonctionEffacement
    maFonctionAffichage
     
    DoCmd.OpenForm "Formulaire105Planning"
     
    Forms("Formulaire105Planning").OnClose = "=PlanningClose()"
     
    Dim ctl As Control
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemainePrécédente")
    ctl.OnClick = "=TestClick3(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemaineSuivante")
    ctl.OnClick = "=TestClick4(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisPrécédent")
    ctl.OnClick = "=TestClick3(4)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisSuivant")
    ctl.OnClick = "=TestClick4(4)"
    Set ctl = Nothing
     
     
    ''''''''''
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 1 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    Start_Test_Timer
     
    Dim r1 As DAO.Recordset
     
    Set r1 = CurrentDb.OpenRecordset("SELECT N°, Categorie FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] & ";")
     
    r1.MoveFirst
     
    'Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r.Fields(1).Value + " (Identifiant : " + CStr(r.Fields(0).Value) + ")"
    Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r1.Fields(1).Value
    Forms![Formulaire105Planning]![Étiquette620].ForeColor = QBColor(0)
    Forms![Formulaire105Planning]![Étiquette620].FontSize = 18
     
    Forms![Formulaire105Planning]![Texte625] = Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].[Value]
     
     
     
    Dim r70 As DAO.Recordset
    Set r70 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table23HeureQuart;")
    Dim r80 As DAO.Recordset
    Set r80 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table22Jour;")
     
    r70.MoveFirst
    r80.MoveFirst
     
    Dim im As Integer
    Dim jm As Integer
     
    im = r70.Fields(0).Value
    jm = r80.Fields(0).Value
     
    Dim j As Integer
    Dim i As Integer
     
    For j = 1 To im - 1
    For i = 1 To jm
     
    Set ctl = Forms![Formulaire105Planning].Controls("Creneau" + CStr(j) + CStr(i))
    ctl.OnClick = "=TestClick(" + CStr(j) + ", " + CStr(i) + ")"
    Set ctl = Nothing
     
    Next i
    Next j
     
    ''''''''''
     
    Forms![Formulaire105Planning]![Texte610] = Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value]
     
    MsgBox "Vous pouvez faire une réservation. Attention, vous n'avez que 5 minutes pour réaliser votre réservation. Ce délai dépassé, le planning se fermera automatiquement, et vous devrez recommencer la démarche depuis le formulaire précédent."
     
    End If
     
    End If
     
    End If
     
    End Function
     
    Public Function PlanningClose()
     
    Stop_Test_Timer
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 0 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    End Function
     
    Public Function TestClick3(k)
     
    Dim i As Integer
    i = CStr(CInt(Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].[Value]) - k)
     
    If Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "0" Or Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "1" Or Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "2" Or Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "3" Then
     
    If k = 4 Or Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = "0" Then
    MsgBox "Vous ne pouvez pas accéder à une semaine passée."
    Else
     
    Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = i
     
    maFonctionAffichage2
     
    End If
     
    Else
     
    Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = i
     
    maFonctionAffichage2
     
    End If
     
    End Function
     
    Public Function TestClick4(k)
     
    Dim i As Integer
    i = CStr(CInt(Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].[Value]) + k)
     
    Forms![Formulaire102FicheMachine]![Controle0310TexteCache2] = i
     
    maFonctionAffichage2
     
    End Function
     
     
    Public Function TestClick(k, l)
        Forms![Formulaire105Planning]![Texte621] = k
        Forms![Formulaire105Planning]![Texte623] = l
        DoCmd.OpenForm "Formulaire106PreReservation"
    End Function
     
    Public Function maFonction0403Click()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire103DocAssocies]![Controle0402Liste].ListCount
     
    Forms![Formulaire103DocAssocies]![Controle0402Liste].Selected(i - 1) = True
     
    Next
     
    End Function
     
    Public Function maFonction0404Click()
     
     
      Dim varI As Variant
     
      If Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemsSelected.Count = 0 Then
        MsgBox "Veuillez selectionner un document. Si vous avez déjà sélectionné un document, celui-ci n'est pas disponible."
      Else
        For Each varI In Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemsSelected
     
     
    Dim oRst As DAO.Recordset
    Dim FilePath As String
     
     'Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines.[Documents associés].FileData FROM Table01Machines WHERE Table01Machines.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines.[Documents associés].FileName= '" & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI) & "';")
            Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines1PJDocAssocies.Contenu.FileData FROM Table01Machines1PJDocAssocies WHERE Table01Machines1PJDocAssocies.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines1PJDocAssocies.Contenu.FileName= '" & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI) & "';")
     
            FilePath = Environ("Temp") & "\" & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI)
     
            If Not Dir(FilePath, vbHidden) <> "" Then
            oRst.Fields(0).SaveToFile FilePath
            Else
            Kill FilePath
            oRst.Fields(0).SaveToFile FilePath
            End If
     
             'nécessite d'activer reference Microsoft Shell Controls and Automation
        'dans la fenêtre VisualBasic Outils ->Rérences
        Dim objShell As Shell
        Set objShell = New Shell
        objShell.ShellExecute Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI), "", Environ("Temp"), "open", 1
     
       Next varI
      End If
     
    End Function
     
    Public Function maFonction0405Click()
     
     
     Dim varI As Variant
     
      If Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemsSelected.Count = 0 Then
        MsgBox "Veuillez selectionner un document. Si vous avez déjà sélectionné un document, celui-ci n'est pas disponible."
      Else
     
     
      Dim objShell As Shell
    Dim objFolder As Folder
     
    Set objShell = New Shell
    Set objFolder = objShell.BrowseForFolder(0, "Enregistrer sous", 0)
     
      If Not objFolder Is Nothing Then
     
      Dim i As Integer
      i = 0
     
        For Each varI In Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemsSelected
     
     
    Dim oRst As DAO.Recordset
    Dim FilePath As String
     
    ''''''''''''''''''''Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines.[Documents associés].FileData FROM Table01Machines WHERE Table01Machines.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines.[Documents associés].FileName= '" & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI) & "';")
            Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines1PJDocAssocies.Contenu.FileData FROM Table01Machines1PJDocAssocies WHERE Table01Machines1PJDocAssocies.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines1PJDocAssocies.Contenu.FileName= '" & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI) & "';")
     
            FilePath = "S:\Z_Archive Fichiers et Dossiers\Base principal\" + "\" + Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemData(varI)
     
            oRst.Fields(0).SaveToFile FilePath
     
            objFolder.MoveHere FilePath
     
            i = i + 1
     
       Next varI
     
       If i = 1 Then
       MsgBox "Le fichier a été enregistré dans " & objFolder & "."
       Else
       MsgBox "Les " & Forms![Formulaire103DocAssocies]![Controle0402Liste].ItemsSelected.Count & " fichiers ont été enregistrés dans " & objFolder & "."
       End If
     
      End If
     
      End If
     
    End Function
     
    Public Function maFonction0503Click()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ListCount
     
    Forms![Formulaire104DocLogAssocie]![Controle0502Liste].Selected(i - 1) = True
     
    Next
     
    End Function
     
    Public Function maFonction0504Click()
     
     
      Dim varI As Variant
     
      If Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemsSelected.Count = 0 Then
        MsgBox "Veuillez selectionner un document. Si vous avez déjà sélectionné un document, celui-ci n'est pas disponible."
      Else
        For Each varI In Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemsSelected
     
     
    Dim oRst As DAO.Recordset
    Dim FilePath As String
     
    'Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines.[Documents logiciel associé].FileData FROM Table01Machines WHERE Table01Machines.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines.[Documents logiciel associé].FileName= '" & Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI) & "';")
            Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines2PJDocLogAssocie.Contenu.FileData FROM Table01Machines2PJDocLogAssocie WHERE Table01Machines2PJDocLogAssocie.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines2PJDocLogAssocie.Contenu.FileName= '" & Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI) & "';")
     
            FilePath = Environ("Temp") & "\" & Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI)
     
            If Not Dir(FilePath, vbHidden) <> "" Then
            oRst.Fields(0).SaveToFile FilePath
            Else
            Kill FilePath
            oRst.Fields(0).SaveToFile FilePath
            End If
     
     
             'nécessite d'activer reference Microsoft Shell Controls and Automation
        'dans la fenêtre VisualBasic Outils ->Rérences
        Dim objShell As Shell
        Set objShell = New Shell
        objShell.ShellExecute Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI), "", Environ("Temp"), "open", 1
     
       Next varI
      End If
     
    End Function
     
    Public Function maFonction0505Click()
     
     
     Dim varI As Variant
     
      If Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemsSelected.Count = 0 Then
        MsgBox "Veuillez selectionner un document. Si vous avez déjà sélectionné un document, celui-ci n'est pas disponible."
      Else
     
     
      Dim objShell As Shell
    Dim objFolder As Folder
     
    Set objShell = New Shell
    Set objFolder = objShell.BrowseForFolder(0, "Enregistrer sous", 0)
     
      If Not objFolder Is Nothing Then
     
      Dim i As Integer
      i = 0
     
        For Each varI In Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemsSelected
     
     
    Dim oRst As DAO.Recordset
    Dim FilePath As String
     
    ''''''''''''''''''''Set oRst = CurrentDb.OpenRecordset("SELECT Table01Machines.[Documents logicilel associé].FileData FROM Table01Machines WHERE Table01Machines.N°= " & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value] & " AND Table01Machines.[Documents logiciel associé].FileName= '" & Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI) & "';")
     
            FilePath = "S:\Z_Archive Fichiers et Dossiers\Base principal\" + "\" + Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemData(varI)
     
            oRst.Fields(0).SaveToFile FilePath
     
            objFolder.MoveHere FilePath
     
            i = i + 1
     
       Next varI
     
       If i = 1 Then
       MsgBox "Le fichier a été enregistré dans " & objFolder & "."
       Else
       MsgBox "Les " & Forms![Formulaire104DocLogAssocie]![Controle0502Liste].ItemsSelected.Count & " fichiers ont été enregistrés dans " & objFolder & "."
       End If
     
      End If
     
      End If
     
    End Function
     
    Public Function maFonction0602Click()
     
    DoCmd.OpenForm "Formulaire107Reservation"
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Table22Jour.jour FROM Table22Jour WHERE Table22Jour.N°=" & Forms![Formulaire105Planning]![Texte623].Value & ";")
    r.MoveFirst
    Forms![Formulaire107Reservation]![Controle0711Jour].Value = r.Fields(0).Value
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Table23HeureQuart.heure FROM Table23HeureQuart WHERE Table23HeureQuart.N°=" & Forms![Formulaire105Planning]![Texte621].Value & ";")
    r2.MoveFirst
    Forms![Formulaire107Reservation]![Controle0712HeureDebut].Value = r2.Fields(0).Value
     
    Dim r3 As DAO.Recordset
    Set r3 = CurrentDb.OpenRecordset("SELECT Table22Jour.N° FROM Table22Jour WHERE Table22Jour.jour = '" & Forms![Formulaire107Reservation]![Controle0711Jour].Value & "';")
    r3.MoveFirst
    Forms![Formulaire107Reservation]![Controle0717Date].Caption = Date - Weekday(Date - 1) + CInt(Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].Value) * 7 + r3.Fields(0).Value
     
     
    DoCmd.Close acForm, "Formulaire106PreReservation"
     
    End Function
     
    Public Function maFonction0603Click()
     
    DoCmd.Close acForm, "Formulaire106PreReservation"
     
    End Function
     
    Public Function maFonction0711Click()
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Table22Jour.N° FROM Table22Jour WHERE Table22Jour.jour = '" & Forms![Formulaire107Reservation]![Controle0711Jour].Value & "';")
    r.MoveFirst
    Forms![Formulaire107Reservation]![Controle0717Date].Caption = Date - Weekday(Date) + CInt(Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].Value) * 7 + r.Fields(0).Value + 1
     
    End Function
     
    Public Function maFonction0712Click()
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Table23HeureQuart.N° FROM Table23HeureQuart WHERE Table23HeureQuart.heure = '" & Forms![Formulaire107Reservation]![Controle0713HeureFin].Value & "';")
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Table23HeureQuart.N° FROM Table23HeureQuart WHERE Table23HeureQuart.heure = '" & Forms![Formulaire107Reservation]![Controle0712HeureDebut].Value & "';")
     
    If Not r.EOF Then
    r.MoveFirst
    If Not r.Fields(0).Value > r2.Fields(0).Value Then
    Forms![Formulaire107Reservation]![Controle0713HeureFin].Value = ""
    End If
    End If
     
    End Function
     
    Public Function maFonction0712GotFocus()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire107Reservation]![Controle0712HeureDebut].ListCount
    Forms![Formulaire107Reservation]![Controle0712HeureDebut].RemoveItem (0)
    Next i
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N°, heure FROM Table23HeureQuart;")
    r.MoveFirst
     
    While Not r.EOF
    Forms![Formulaire107Reservation]![Controle0712HeureDebut].AddItem (r.Fields(1).Value)
    r.MoveNext
    Wend
     
    Forms![Formulaire107Reservation]![Controle0712HeureDebut].RemoveItem (Forms![Formulaire107Reservation]![Controle0712HeureDebut].ListCount - 1)
     
    End Function
     
    Public Function maFonction0713GotFocus()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire107Reservation]![Controle0713HeureFin].ListCount
    Forms![Formulaire107Reservation]![Controle0713HeureFin].RemoveItem (0)
    Next i
     
    Dim r0 As DAO.Recordset
    Set r0 = CurrentDb.OpenRecordset("SELECT N°, heure FROM Table23HeureQuart WHERE heure = '" & Forms![Formulaire107Reservation]![Controle0712HeureDebut].Value & "';")
    r0.MoveFirst
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N°, heure FROM Table23HeureQuart WHERE N° > " & r0.Fields(0).Value & ";")
    r.MoveFirst
     
    While Not r.EOF
    Forms![Formulaire107Reservation]![Controle0713HeureFin].AddItem (r.Fields(1).Value)
    r.MoveNext
    Wend
     
    End Function
     
    Public Function maFonction0721Click()
     
     
    If IsNull(Forms![Formulaire107Reservation]![Controle0703Nom]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0704Prenom]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0705Email]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0706Statut]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0711Jour]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0712HeureDebut]) _
    Or IsNull(Forms![Formulaire107Reservation]![Controle0713HeureFin]) Then
     
    MsgBox "Les champs autres que ""Commentaire"" sont obligatoires."
     
    Else
     
    If Not Forms![Formulaire107Reservation]![Controle0705Email] Like "*@*.*" Then
     
    MsgBox "Le champ ""adresse mail"" doit respecter le format : ""*****@***.**""."
     
    Else
     
    Dim j As Integer
     
    j = maFonctionReservationCompatible(Forms![Formulaire107Reservation]![Controle0717Date].Caption, Forms![Formulaire107Reservation]![Controle0712HeureDebut], Forms![Formulaire107Reservation]![Controle0713HeureFin])
     
    If j = 1 Then
     
    MsgBox "Vous ne pouvez pas réserver ce créneau, car il est incompatible avec au moins une autre réservation existante."
     
    Else
     
    Dim max As Integer
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT * FROM Table04HistoriqueReservations")
     
    If r.EOF Then
    max = 1
    Else
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT MAX(Table04HistoriqueReservations.N°) FROM Table04HistoriqueReservations")
    r2.MoveFirst
     
    max = r2.Fields(0).Value
    max = max + 1
    r2.Close
    End If
     
    r.Close
     
    Dim r3 As DAO.Recordset
    Set r3 = CurrentDb.OpenRecordset("SELECT N°, Categorie FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] & ";")
    r3.MoveFirst
     
    Dim r0 As DAO.Recordset
    Set r0 = CurrentDb.OpenRecordset("SELECT N° FROM Table35Statut WHERE statut = '" & Forms![Formulaire107Reservation]![Controle0706Statut].[Value] & "';")
    r0.MoveFirst
     
    Dim numero As String
    numero = ""
    Dim num(8) As Integer
    Dim i As Integer
    For i = 1 To 8
    Randomize
    num(i) = Int(10 * Rnd)
    numero = numero + CStr(num(i))
    Next
     
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL " INSERT INTO Table03Reservations (N°, NomUtilisateur, PrenomUtilisateur, EmailUtilisateur, StatutUtilisateur, N°Machine, CategorieMachine, DateReservee, HeureDebut, HeureFin, DateReservation, HeureReservation, IdentifiantReservation, Commentaire) VALUES (" & max & ", [Formulaires]![Formulaire107Reservation]![Controle0703Nom].[value], [Formulaires]![Formulaire107Reservation]![Controle0704Prenom].[value], [Formulaires]![Formulaire107Reservation]![Controle0705Email].[Value] & '#mailto:' & [Formulaires]![Formulaire107Reservation]![Controle0705Email].[Value], '" & r0.Fields(0).Value & "', '" & r3.Fields(0).Value & "', '" & r3.Fields(1).Value & "', [Formulaires]![Formulaire107Reservation]![Controle0717Date].Caption, [Formulaires]![Formulaire107Reservation]![Controle0712HeureDebut].[value], [Formulaires]![Formulaire107Reservation]![Controle0713HeureFin].[value], DATE(), TIME(), " & numero & _
    ", Forms![Formulaire107Reservation]![Controle0718Commentaire].[value]);"
     
    DoCmd.RunSQL " INSERT INTO Table04HistoriqueReservations (N°, NomUtilisateur, PrenomUtilisateur, EmailUtilisateur, StatutUtilisateur, N°Machine, CategorieMachine, DateReservee, HeureDebut, HeureFin, DateReservation, HeureReservation, IdentifiantReservation, Commentaire, Annulee) VALUES (" & max & ", [Formulaires]![Formulaire107Reservation]![Controle0703Nom].[value], [Formulaires]![Formulaire107Reservation]![Controle0704Prenom].[value], [Formulaires]![Formulaire107Reservation]![Controle0705Email].[Value] & '#mailto:' & [Formulaires]![Formulaire107Reservation]![Controle0705Email].[Value], [Formulaires]![Formulaire107Reservation]![Controle0706Statut].[value], '" & r3.Fields(0).Value & "', '" & r3.Fields(1).Value & "', [Formulaires]![Formulaire107Reservation]![Controle0717Date].Caption, [Formulaires]![Formulaire107Reservation]![Controle0712HeureDebut].[value], [Formulaires]![Formulaire107Reservation]![Controle0713HeureFin" & _
    "].[value], DATE(), TIME(), " & numero & ", Forms![Formulaire107Reservation]![Controle0718Commentaire].[value], 'non');"
     
    DoCmd.SetWarnings True
     
    If IsNull(Forms![Formulaire107Reservation]![Controle0705Email].[Value]) Or Forms![Formulaire107Reservation]![Controle0705Email].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table03Reservations SET [EmailUtilisateur] = '' WHERE Table03Reservations.N° = " & max & ";"
    DoCmd.RunSQL " UPDATE Table04HistoriqueReservations SET [EmailUtilisateur] = '' WHERE Table04HistoriqueReservations.N° = " & max & ";"
    End If
     
    Dim r4 As DAO.Recordset
    Set r4 = CurrentDb.OpenRecordset("SELECT N°, NomUtilisateur, PrenomUtilisateur, EmailUtilisateur, StatutUtilisateur, N°Machine, CategorieMachine, DateReservee, HeureDebut, HeureFin, DateReservation, HeureReservation, IdentifiantReservation, Commentaire FROM Table03Reservations WHERE Table03Reservations.N° = " & max & ";")
    r4.MoveFirst
     
     
    Dim b As Integer
    b = InStr(1, r4.Fields(3).Value, "#mailto:")
    If b > 1 Then
    Dim a As String
    a = Left(r4.Fields(3).Value, b - 1)
    End If
     
    Dim Body As String
     
    Body = "Votre réservation a bien été enregistrée. Voici le récapitulatif de l'opération :" & vbCrLf & vbCrLf & vbCrLf & _
    "Numéro de la réservation : " & r4.Fields(0).Value & vbCrLf & _
    "Numéro de la machine : " & r4.Fields(5).Value & vbCrLf & _
    "Nom de la machine : " & r4.Fields(6).Value & vbCrLf & _
    "Réservation effectuée le " & r4.Fields(10).Value & " à " & r4.Fields(11).Value & "." & vbCrLf & vbCrLf & _
    "Numéro personnel pour annuler la réservation : " & r4.Fields(12).Value & vbCrLf & vbCrLf & vbCrLf & _
    "Données personnelles : " & vbCrLf & vbCrLf & _
    "Nom : " & r4.Fields(1).Value & vbCrLf & _
    "Prénom: " & r4.Fields(2).Value & vbCrLf & _
    "E-mail : " & a & vbCrLf & _
    "Statut : " & r4.Fields(4).Value & vbCrLf & vbCrLf & vbCrLf & _
    "Date : " & r4.Fields(7).Value & vbCrLf & _
    "Horaires : " & r4.Fields(8).Value & " - " & r4.Fields(9).Value & vbCrLf & vbCrLf & vbCrLf & _
    "Commentaire : " & r4.Fields(13).Value
     
    CreateEmail Forms![Formulaire107Reservation]![Controle0705Email].[Value], "Confirmation de réservation de la machine " & r3.Fields(1).Value, Body
     
    MsgBox "Votre réservation a bien été enregistrée. Vous aurez besoin de son numéro pour la modifier. N° personnel de réservation : " + numero + "." & vbCrLf & _
    "Si vous possèdez un compte Outlook sur votre session, un mail récapitulant l'ensemble des détails de la réservation va vous être envoyé par ce compte, à l'adresse mail " & _
    "renseignée. Si vous n'avez pas de compte Outlook, veuillez noter le numéro personnel de réservation, et vous pouvez fermer Outlook."
     
     
    DoCmd.Close acForm, "Formulaire107Reservation"
     
    maFonctionEffacement
    maFonctionAffichage
     
    DoCmd.OpenForm "Formulaire105Planning", acNormal, , , , acWindowNormal
     
    Forms("Formulaire105Planning").OnClose = "=PlanningClose()"
     
    Dim ctl As Control
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemainePrécédente")
    ctl.OnClick = "=TestClick3(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemaineSuivante")
    ctl.OnClick = "=TestClick4(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisPrécédent")
    ctl.OnClick = "=TestClick3(4)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisSuivant")
    ctl.OnClick = "=TestClick4(4)"
    Set ctl = Nothing
     
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 1 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    Start_Test_Timer
     
    Dim r1 As DAO.Recordset
     
    Set r1 = CurrentDb.OpenRecordset("SELECT N°, Categorie FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] & ";")
     
    r1.MoveFirst
     
    'Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r.Fields(1).Value + " (Identifiant : " + CStr(r.Fields(0).Value) + ")"
    Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r1.Fields(1).Value
    Forms![Formulaire105Planning]![Étiquette620].ForeColor = QBColor(0)
    Forms![Formulaire105Planning]![Étiquette620].FontSize = 18
     
    Forms![Formulaire105Planning]![Texte625] = Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].[Value]
     
     
    Dim r70 As DAO.Recordset
    Set r70 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table23HeureQuart;")
    Dim r80 As DAO.Recordset
    Set r80 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table22Jour;")
     
    r70.MoveFirst
    r80.MoveFirst
     
    Dim im As Integer
    Dim jm As Integer
     
    im = r70.Fields(0).Value
    jm = r80.Fields(0).Value
     
     
     
    For j = 1 To im - 1
    For i = 1 To jm
     
    Set ctl = Forms![Formulaire105Planning].Controls("Creneau" + CStr(j) + CStr(i))
    ctl.OnClick = "=TestClick(" + CStr(j) + ", " + CStr(i) + ")"
    Set ctl = Nothing
     
    Next i
    Next j
     
     
    Forms![Formulaire105Planning]![Texte610] = Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value]
     
    MsgBox "Vous pouvez faire une réservation. Attention, vous n'avez que 5 minutes pour réaliser votre réservation. Ce délai dépassé, le planning se fermera automatiquement, et vous devrez recommencer la démarche depuis le formulaire précédent."
     
     
    End If
     
    End If
     
    End If
     
    End Function
     
    Public Function maFonction0804Click()
     
    DoCmd.OpenForm "Formulaire109NumeroReservation"
     
    End Function
     
    Public Function maFonction0904Click()
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT IdentifiantReservation FROM Table03Reservations WHERE N° = " & Forms![Formulaire108InfoReservation]![Controle0803TexteCache1] & ";")
    r.MoveFirst
     
     
    If Forms![Formulaire109NumeroReservation]![Controle0902Numero] = CStr(r.Fields(0).Value) Then
     
    DoCmd.OpenForm "Formulaire110SupprimerReservation"
    Forms![Formulaire110SupprimerReservation]![Controle1004TexteCache1] = Forms![Formulaire108InfoReservation]![Controle0803TexteCache1]
     
    Else
     
    MsgBox "Numéro incorrect."
    Forms![Formulaire109NumeroReservation]![Controle0902Numero] = Null
     
    End If
     
    End Function
     
    Public Function maFonction1002Click()
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "DELETE FROM Table03Reservations WHERE Table03Reservations.N°= " & Forms![Formulaire110SupprimerReservation]![Controle1004TexteCache1] & ";"
     
    DoCmd.RunSQL "UPDATE Table04HistoriqueReservations SET Table04HistoriqueReservations.[Annulee] = 'oui', Table04HistoriqueReservations.[DateAnnulation] = Date(), Table04HistoriqueReservations.[HeureAnnulation] = Time() WHERE Table04HistoriqueReservations.N°= " & Forms![Formulaire110SupprimerReservation]![Controle1004TexteCache1] & ";"
     
    DoCmd.SetWarnings True
     
    DoCmd.Close acForm, "Formulaire110SupprimerReservation"
    DoCmd.Close acForm, "Formulaire109NumeroReservation"
    DoCmd.Close acForm, "Formulaire108InfoReservation"
     
    maFonctionEffacement
    maFonctionAffichage
     
    DoCmd.OpenForm "Formulaire105Planning", acNormal, , , , acWindowNormal
     
    Forms("Formulaire105Planning").OnClose = "=PlanningClose()"
     
    Dim ctl As Control
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemainePrécédente")
    ctl.OnClick = "=TestClick3(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("SemaineSuivante")
    ctl.OnClick = "=TestClick4(1)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisPrécédent")
    ctl.OnClick = "=TestClick3(4)"
    Set ctl = Nothing
     
    Set ctl = Forms![Formulaire105Planning]![ControleSousform].Controls("MoisSuivant")
    ctl.OnClick = "=TestClick4(4)"
    Set ctl = Nothing
     
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 1 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    Start_Test_Timer
     
    Dim r1 As DAO.Recordset
     
    Set r1 = CurrentDb.OpenRecordset("SELECT N°, Categorie FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire102FicheMachine]![Controle0309TexteCache1] & ";")
     
    r1.MoveFirst
     
    'Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r.Fields(1).Value + " (Identifiant : " + CStr(r.Fields(0).Value) + ")"
    Forms![Formulaire105Planning]![Étiquette620].Caption = "Planning de : " + r1.Fields(1).Value
    Forms![Formulaire105Planning]![Étiquette620].ForeColor = QBColor(0)
    Forms![Formulaire105Planning]![Étiquette620].FontSize = 18
     
    Forms![Formulaire105Planning]![Texte625] = Forms![Formulaire102FicheMachine]![Controle0310TexteCache2].[Value]
     
     
    Dim r70 As DAO.Recordset
    Set r70 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table23HeureQuart;")
    Dim r80 As DAO.Recordset
    Set r80 = CurrentDb.OpenRecordset("SELECT max(N°) FROM Table22Jour;")
     
    r70.MoveFirst
    r80.MoveFirst
     
    Dim im As Integer
    Dim jm As Integer
     
    im = r70.Fields(0).Value
    jm = r80.Fields(0).Value
     
     
     
    For j = 1 To im - 1
    For i = 1 To jm
     
    Set ctl = Forms![Formulaire105Planning].Controls("Creneau" + CStr(j) + CStr(i))
    ctl.OnClick = "=TestClick(" + CStr(j) + ", " + CStr(i) + ")"
    Set ctl = Nothing
     
    Next i
    Next j
     
     
    Forms![Formulaire105Planning]![Texte610] = Forms![Formulaire102FicheMachine]![Controle0309TexteCache1].[Value]
     
    MsgBox "Vous pouvez faire une réservation. Attention, vous n'avez que 5 minutes pour réaliser votre réservation. Ce délai dépassé, le planning se fermera automatiquement, et vous devrez recommencer la démarche depuis le formulaire précédent."
     
     
    End Function
     
    Public Function maFonction1003Click()
     
    DoCmd.Close acForm, "Formulaire110SupprimerReservation"
    DoCmd.Close acForm, "Formulaire109NumeroReservation"
    DoCmd.Close acForm, "Formulaire108InfoReservation"
     
    End Function
     
    Public Function maFonction1107Click()
     
    If IsNull(Forms![Formulaire201Identification]![Controle1103Nom]) Or IsNull(Forms![Formulaire201Identification]![Controle1104MDP]) Then
     
        MsgBox "Au moins un des champs d'identification est vide."
     
        Else
     
        Dim r As DAO.Recordset
        Set r = CurrentDb.OpenRecordset("SELECT N°, Nom, Prenom, MDP FROM Table06ComptesTechniciens")
     
     
        If r.EOF Then
            MsgBox "Aucun technicien n'a accès à l'espace de gestion interne. Contactez l'administrateur pour résoudre le problème."
            Else
     
            r.MoveFirst
     
            Dim a As String
            Dim b As String
            Dim c As Integer
            c = 0
     
            While Not r.EOF
     
                If r.Fields(1).Value = Forms![Formulaire201Identification]![Controle1103Nom].Value And r.Fields(3).Value = Forms![Formulaire201Identification]![Controle1104MDP].Value And c = 0 Then
     
                    a = r.Fields(2).Value
                    b = r.Fields(1).Value
                    c = r.Fields(0).Value
     
                End If
     
                r.MoveNext
     
            Wend
     
            If c = 0 Then
     
                MsgBox "Identifiants incorrects."
     
                Forms![Formulaire201Identification]![Controle1103Nom] = Null
     
                Forms![Formulaire201Identification]![Controle1104MDP] = Null
     
                Else
     
                Dim r0 As DAO.Recordset
                Set r0 = CurrentDb.OpenRecordset("SELECT Etat FROM Table12VariablesGlobales;")
                r0.MoveFirst
     
                If r0.Fields(0).Value = 1 Then
     
                    MsgBox "Une réservation est en cours, veuillez réessayer dans quelques minutes."
     
                    Else
     
                    If r0.Fields(0).Value = 2 Then
     
                        MsgBox "La base de donnée est en cours de traitement par un technicien, veuillez réessayer plus tard."
     
                        Else
     
     
                        DoCmd.SetWarnings False
                        DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 2 WHERE N° = 1;"
                        DoCmd.SetWarnings True
     
     
                        DoCmd.OpenForm "Formulaire202GestionInterne", acDesign, , , , acHidden
     
                        Forms![Formulaire202GestionInterne]![Controle1202Utilisateur].Caption = "Connecté(e) : " & a & " " & b
     
                        DoCmd.SetWarnings False
     
                        DoCmd.Close acForm, "Formulaire202GestionInterne"
     
                        DoCmd.SetWarnings True
     
     
                        DoCmd.OpenForm "Formulaire202GestionInterne"
     
                        Forms("Formulaire202GestionInterne").OnClose = "=PlanningClose()"
     
                        Forms![Formulaire202GestionInterne]![Controle1214TexteCache1] = CStr(c)
     
                        DoCmd.Close acForm, "Formulaire201Identification"
     
                    End If
                End If
            End If
        End If
    End If
     
    End Function
     
    Public Function maFonction1203Click()
     
    DoCmd.OpenForm "Formulaire203AjouterMachine"
    Forms![Formulaire202GestionInterne]![Controle1215TexteCache2] = 1
     
    End Function
     
    Public Function maFonction1216Click()
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL " UPDATE Table12VariablesGlobales SET Etat = 0 WHERE N° = 1;"
    DoCmd.SetWarnings True
     
    DoCmd.Close acForm, "Formulaire202GestionInterne"
     
    End Function
     
    Public Function maFonction1209Click()
     
    ''''DoCmd.OpenReport "Table05HistoriqueModifications", acViewReport, , , acWindowNormal
    DoCmd.OpenForm "Formulaire305Requete21"
     
    End Function
     
    Public Function maFonction1210Click()
     
    ''''DoCmd.OpenReport "Table01Machines", acViewReport, , , acWindowNormal
    DoCmd.OpenForm "Formulaire304Requete20"
     
    End Function
     
    Public Function maFonction1211Click()
     
    DoCmd.OpenForm "Formulaire209DocSecurite"
     
    End Function
     
    Public Function maFonction1207Click()
     
    DoCmd.OpenForm "Formulaire207ModifierPictogramme"
     
    End Function
     
    Public Function maFonction1213Click()
     
    maFonctionReinitialisationPictogrammes
     
    MsgBox "Le pictogrammes ont été mis à jour."
     
    End Function
     
    Public Function maFonction1204Click()
     
    DoCmd.OpenForm "Formulaire204ModifierMachine"
    Forms![Formulaire202GestionInterne]![Controle1215TexteCache2] = 2
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3].Visible = False
     
    End Function
     
    Public Function maFonction1205Click()
     
    DoCmd.OpenForm "Formulaire205ModifierEtatMachine"
     
    End Function
     
    Public Function maFonction1206Click()
     
    DoCmd.OpenForm "Formulaire206AjouterPictogramme"
     
    End Function
     
    Public Function maFonction1208Click()
     
    DoCmd.OpenForm "Formulaire208DetailReservation"
     
    End Function
     
    Public Function maFonction1212Click()
     
    DoCmd.OpenForm "Formulaire210ChangementMDP1"
     
    End Function
     
    Public Function maFonction1303Click()
     
    DoCmd.Close acForm, "Formulaire203AjouterMachine"
     
    End Function
     
    Public Function maFonction1304Click()
     
     
    Dim picto As DAO.Recordset
    Set picto = CurrentDb.OpenRecordset("SELECT Chemin, description, N° FROM Table02Pictogrammes ORDER BY N°;")
     
    Dim k As Integer
    k = 0
     
    picto.MoveFirst
     
    While Not picto.EOF
    k = k + 1
    picto.MoveNext
    Wend
     
     
    DoCmd.OpenForm "Formulaire215ChoixPictogrammes"
     
    Dim ctrl As Control
    Set ctrl = Forms![Formulaire215ChoixPictogrammes].Controls("Valider")
    ctrl.OnClick = "=Click2(" & Forms![Formulaire202GestionInterne]![Controle1215TexteCache2].Value & ")"
     
     
    Forms![Formulaire203AjouterMachine]![Controle1308TexteCache1] = k
     
    Dim n As Integer
    Dim varI As Variant
    Set varI = Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1]
    For i = 1 To Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].ListCount
     
    For n = 1 To k
    If Forms![Formulaire215ChoixPictogrammes].[Formulaire216ChoixPictogrammesBis].Controls("Texte" + CStr(n)).Caption = varI.ItemData(i - 1) Then
    Forms![Formulaire215ChoixPictogrammes].[Formulaire216ChoixPictogrammesBis].Controls("Case" + CStr(n)) = -1
     
    End If
    Next n
    Next
     
     
    End Function
     
    Public Function Click2(a)
     
    Dim k As Integer
    Dim j As Integer
    Dim r As DAO.Recordset
    Dim ctrl As Control
    Dim i As Integer
    Dim m As String
     
    If a = 1 Then
     
    For k = 1 To Forms![Formulaire203AjouterMachine]![Controle1305Liste].ListCount
    Forms![Formulaire203AjouterMachine]![Controle1305Liste].RemoveItem (0)
    Next k
     
    For k = 1 To Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].ListCount
    Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].RemoveItem (0)
    Next k
     
    j = Forms![Formulaire203AjouterMachine]![Controle1308TexteCache1].Value
     
     
    For i = 1 To j
     
    Set ctrl = Forms![Formulaire215ChoixPictogrammes]![Formulaire215ChoixPictogrammesBis].Controls("Case" & CStr(i))
    If Not ctrl.Value = 0 Then
    m = Forms![Formulaire215ChoixPictogrammes]![Formulaire215ChoixPictogrammesBis].Controls("Texte" & CStr(i)).Caption
     
    Set r = CurrentDb.OpenRecordset("SELECT description FROM Table02Pictogrammes WHERE N°= " & m)
    r.MoveFirst
     
    Forms![Formulaire203AjouterMachine]![Controle1305Liste].AddItem (m + " " + r.Fields(0).Value)
    Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].AddItem (m)
    End If
     
    Next i
     
    DoCmd.Close acForm, "Formulaire215ChoixPictogrammes"
     
    Else
     
     
    For k = 1 To Forms![Formulaire204ModifierMachine]![Controle1405Liste].ListCount
    Forms![Formulaire204ModifierMachine]![Controle1405Liste].RemoveItem (0)
    Next k
     
    For k = 1 To Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].ListCount
    Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].RemoveItem (0)
    Next k
     
    j = Forms![Formulaire204ModifierMachine]![Controle1408TexteCache1].Value
     
     
    For i = 1 To j
     
    Set ctrl = Forms![Formulaire215ChoixPictogrammes]![Formulaire216ChoixPictogrammesBis].Controls("Case" & CStr(i))
    If Not ctrl.Value = 0 Then
    m = Forms![Formulaire215ChoixPictogrammes]![Formulaire216ChoixPictogrammesBis].Controls("Texte" & CStr(i)).Caption
     
    Set r = CurrentDb.OpenRecordset("SELECT description FROM Table02Pictogrammes WHERE N°= " & m)
    r.MoveFirst
     
     
    Forms![Formulaire204ModifierMachine]![Controle1405Liste].AddItem (m + " " + r.Fields(0).Value)
    Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].AddItem (m)
    End If
     
    Next i
     
    DoCmd.Close acForm, "Formulaire215ChoixPictogrammes"
     
     
    End If
     
     
    End Function
     
     
    Public Function maFonction1310Click()
     
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie]) Then
    MsgBox "Le champ ""Catégorie"" doit être non vide."
    Else
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2301Appartenance]) Then
    MsgBox "Le champ ""Appartenance"" doit être non vide."
    Else
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2304Batiment]) Then
    MsgBox "Le champ ""Bâtiment"" doit être non vide."
    Else
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2305Service]) Then
    MsgBox "Le champ ""Service"" doit être non vide."
    Else
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2306Salle]) Then
    MsgBox "Le champ ""Salle"" doit être non vide."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Categorie FROM Table01Machines")
    r.MoveFirst
     
    Dim i As Integer
    i = 0
     
    While Not r.EOF
     
    If r.Fields(0).Value = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[Value] Then
    i = 1
    End If
     
    r.MoveNext
     
    Wend
     
    If i = 1 Then
    MsgBox "Il existe déjà une machine ayant la même valeur pour le champ ""Catégorie"". Choisissez en un autre, ou modifiez la machine portant le même nom dans le formulaire ""Modifier une machine""."
     
    Else
     
    Set r01 = CurrentDb.OpenRecordset("SELECT N° FROM Table31Appartenance WHERE Intitule = '" & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2301Appartenance] & "'")
    r01.MoveFirst
    Set r02 = CurrentDb.OpenRecordset("SELECT N° FROM Table32Batiment WHERE Intitule = '" & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2304Batiment].[Value] & "'")
    r02.MoveFirst
    Set r03 = CurrentDb.OpenRecordset("SELECT N° FROM Table33Service WHERE Intitule = '" & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2305Service].[Value] & "'")
    r03.MoveFirst
    Set r04 = CurrentDb.OpenRecordset("SELECT N° FROM Table34Salle WHERE Intitule = '" & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2306Salle].[Value] & "'")
    r04.MoveFirst
     
     
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL " INSERT INTO Table01Machines ([Appartenance], [Categorie], [CarPrincipales], [Batiment], [Service], [Salle], [REC1], [TelREC1], [InterneREC1], [MailREC1], [REC2], [TelREC2], [InterneREC2], [MailREC2], [RDoc], [TelRDoc], [InterneRDoc], [MailRDoc], [RTech], [TelRTech], [InterneRTech], [MailRTech], [LogAssocie], [Demandeur], [Fournisseur], [Disponibilite]) " & _
     "VALUES (" & _
     r01.Fields(0).Value & ", Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2303CarPrincipales].[value], " & r02.Fields(0).Value & ", " & _
     r03.Fields(0).Value & ", " & r04.Fields(0).Value & ", " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2307REC1].[value], Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2308TelREC1].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2309InterneREC1].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2310MailREC1].[value] & '#mailto:' & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2310MailREC1].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2311REC2].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2312TelREC2].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2313InterneREC2].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2314MailREC2].[value] & '#mailto:' & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2314MailREC2].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2315RDoc].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2316TelRDoc].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2317InterneRDoc].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2318MailRDoc].[value] & '#mailto:' & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2318MailRDoc].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2319RTech].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2320TelRTech].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2321InterneRTech].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2322MailRTech].[value] & '#mailto:' & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2322MailRTech].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2323LogAssocie].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2324Demandeur].[value], " & _
     "Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2325Fournisseur].[value], " & _
     "1);"
     
     
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2310MailREC1].[Value]) Or Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2310MailREC1].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailREC1] = '' WHERE Categorie = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[value];"
    End If
     
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2314MailREC2].[Value]) Or Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2314MailREC2].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailREC2] = '' WHERE Categorie = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[value];"
    End If
     
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2318MailRDoc].[Value]) Or Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2318MailRDoc].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailRDoc] = '' WHERE Categorie = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[value];"
    End If
     
    If IsNull(Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2322MailRTech].[Value]) Or Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2322MailRTech].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailRTech] = '' WHERE Categorie = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[value];"
    End If
     
     
     
    DoCmd.SetWarnings True
     
    Set r = CurrentDb.OpenRecordset("SELECT N°, Categorie FROM Table01Machines")
    r.MoveFirst
     
    Dim k As Integer
    Dim Cat As String
     
    While Not r.EOF
     
    If r.Fields(1).Value = Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[Value] Then
    k = r.Fields(0).Value
    Cat = r.Fields(1).Value
    End If
     
    r.MoveNext
     
    Wend
     
    DoCmd.SetWarnings False
     
     
    DoCmd.RunSQL "Delete Table01Machines.Pictogrammes.Value FROM Table01Machines WHERE Table01Machines.N° =  " & CStr(k) & ";"
     
    For i = 1 To Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].ListCount
     
    j = Forms![Formulaire203AjouterMachine]![Controle1306ListeCache1].ItemData(i - 1)
     
    DoCmd.RunSQL "INSERT INTO Table01Machines ( Pictogrammes.[Value] ) VALUES (" & CStr(j) & ") WHERE Table01Machines.N° =  " & CStr(k) & ";"
     
    Next
     
     
     
     
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Nom, Prenom FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1])
    r2.MoveFirst
     
    Dim Str As String
     
    Str = "Machine : " & Forms![Formulaire203AjouterMachine]![Controle1302SousForm]![Controle2302Categorie].[Value] & " (N° : " & CStr(k) & ")"
     
    DoCmd.RunSQL " INSERT INTO Table05HistoriqueModifications ([Date], [Heure], [TypeAction], [Detail], [Technicien]) VALUES (Date(), Time(), ""Ajout d'une machine"", """ & Str & """,""" & r2.Fields(1).Value & " " & r2.Fields(0).Value & """);"
     
     
     
    DoCmd.RunSQL " INSERT INTO Table01Machines1PJDocAssocies ([N°]) VALUES (" & CStr(k) & ");"
    DoCmd.RunSQL " INSERT INTO Table01Machines2PJDocLogAssocie ([N°]) VALUES (" & CStr(k) & ");"
    DoCmd.RunSQL " INSERT INTO Table01Machines3PJDevis ([N°]) VALUES (" & CStr(k) & ");"
    DoCmd.RunSQL " INSERT INTO Table01Machines4PJBonCommande ([N°]) VALUES (" & CStr(k) & ");"
    DoCmd.RunSQL " INSERT INTO Table01Machines5PJBonLivraison ([N°]) VALUES (" & CStr(k) & ");"
     
    DoCmd.RunSQL " UPDATE Table01Machines SET [PJDocAssocies] = " & k & " WHERE N° = " & k & ";"
    DoCmd.RunSQL " UPDATE Table01Machines SET [PJDocAssocies] = " & k & ", [PJDocLogAssocie] = " & k & ", [PJDevis] = " & k & ", [PJBonCommande] = " & k & ", [PJBonLivraison] = " & k & " WHERE N° = " & k & ";"
     
     
    DoCmd.SetWarnings True
     
     
     
    MsgBox "Une nouvelle machine à été ajoutée à la base de donnée. Son numéro d'identification est le " & CStr(k) & ". Les pictogrammes choisis ont également été enregistrés. Pour modifier ces informations, vous devez utiliser le formulaire ""Modifier une machine""," & _
    " dont l'accès se trouve dans le menu précédent. Vous pouvez maintenant associer des pièces jointes à cette nouvelle machine dans la fenêtre apparaissant à la fermeture de celle-ci."
     
     
     
     
    DoCmd.OpenForm "Formulaire214PiecesJointes", , , , , acHidden
     
    'Forms![Formulaire214PiecesJointes].Refresh
    'Querys![Requete22Formulaire214PiecesJointes].Requery
     
     
    'Forms![Formulaire214PiecesJointes].Form.Recordset.AbsolutePosition = 0
    '
    'While Forms![Formulaire214PiecesJointes].Form.Recordset.N° <> k
    'Forms![Formulaire214PiecesJointes].Form.Recordset.MoveNext
    'Wend
     
    Forms![Formulaire214PiecesJointes].[Controle2403PJ1].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire214PiecesJointes].[Controle2403PJ1].Form.Recordset.N° <> k
    Forms![Formulaire214PiecesJointes].[Controle2403PJ1].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire214PiecesJointes].[Controle2404PJ2].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire214PiecesJointes].[Controle2404PJ2].Form.Recordset.N° <> k
    Forms![Formulaire214PiecesJointes].[Controle2404PJ2].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire214PiecesJointes].[Controle2405PJ3].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire214PiecesJointes].[Controle2405PJ3].Form.Recordset.N° <> k
    Forms![Formulaire214PiecesJointes].[Controle2405PJ3].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire214PiecesJointes].[Controle2406PJ4].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire214PiecesJointes].[Controle2406PJ4].Form.Recordset.N° <> k
    Forms![Formulaire214PiecesJointes].[Controle2406PJ4].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire214PiecesJointes].[Controle2407PJ5].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire214PiecesJointes].[Controle2407PJ5].Form.Recordset.N° <> k
    Forms![Formulaire214PiecesJointes].[Controle2407PJ5].Form.Recordset.MoveNext
    Wend
     
     
    Forms![Formulaire214PiecesJointes]![Controle2402Nom].Caption = Cat
     
    DoCmd.OpenForm "Formulaire214PiecesJointes", , , , , acNormal
     
    DoCmd.Close acForm, "Formulaire203AjouterMachine"
     
    End If
     
    End If
    End If
    End If
    End If
    End If
     
    End Function
     
    Public Function maFonction1403Click()
     
    DoCmd.Close acForm, "Formulaire204ModifierMachine"
     
    End Function
     
    Public Function maFonction1404Click()
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche en haut de page."
     
    Else
     
     
    Dim picto As DAO.Recordset
    Set picto = CurrentDb.OpenRecordset("SELECT Chemin, description, N° FROM Table02Pictogrammes ORDER BY N°;")
     
    Dim k As Integer
    k = 0
     
    picto.MoveFirst
     
    While Not picto.EOF
    k = k + 1
    picto.MoveNext
    Wend
     
     
    DoCmd.OpenForm "Formulaire215ChoixPictogrammes"
     
    Dim ctrl As Control
    Set ctrl = Forms![Formulaire215ChoixPictogrammes].Controls("Valider")
    ctrl.OnClick = "=Click2(" & Forms![Formulaire202GestionInterne]![Controle1215TexteCache2].Value & ")"
     
     
    Forms![Formulaire204ModifierMachine]![Controle1408TexteCache1] = k
     
    Dim n As Integer
    Dim varI As Variant
    Set varI = Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1]
    For i = 1 To Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].ListCount
     
    For n = 1 To k
    If Forms![Formulaire215ChoixPictogrammes].[Formulaire216ChoixPictogrammesBis].Controls("Texte" + CStr(n)).Caption = varI.ItemData(i - 1) Then
    Forms![Formulaire215ChoixPictogrammes].[Formulaire216ChoixPictogrammesBis].Controls("Case" + CStr(n)) = -1
     
    End If
    Next n
    Next
     
    End If
     
    End Function
     
    Public Function maFonction1410Click()
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche en haut de page."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Categorie FROM Table01Machines WHERE Table01Machines.N° = " & Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3] & ";")
    r.MoveFirst
     
    Set r01 = CurrentDb.OpenRecordset("SELECT N° FROM Table31Appartenance WHERE Intitule = '" & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2301Appartenance] & "'")
    r01.MoveFirst
    Set r02 = CurrentDb.OpenRecordset("SELECT N° FROM Table32Batiment WHERE Intitule = '" & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2304Batiment] & "'")
    r02.MoveFirst
    Set r03 = CurrentDb.OpenRecordset("SELECT N° FROM Table33Service WHERE Intitule = '" & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2305Service] & "'")
    r03.MoveFirst
    Set r04 = CurrentDb.OpenRecordset("SELECT N° FROM Table34Salle WHERE Intitule = '" & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2306Salle] & "'")
    r04.MoveFirst
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "UPDATE Table01Machines SET " & _
    "Table01Machines.[Appartenance] = " & CStr(r01.Fields(0).Value) & ", Table01Machines.[Categorie] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2302Categorie], " & _
    "Table01Machines.[CarPrincipales] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2303CarPrincipales], Table01Machines.[Batiment] = " & CStr(r02.Fields(0).Value) & ", " & _
    "Table01Machines.[Service] = " & CStr(r03.Fields(0).Value) & ", Table01Machines.[Salle] = " & CStr(r04.Fields(0).Value) & ", " & _
    "Table01Machines.[REC1] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2307REC1], " & _
    "Table01Machines.[TelREC1] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2308TelREC1], " & _
    "Table01Machines.[InterneREC1] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2309InterneREC1], " & _
    "Table01Machines.[MailREC1] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2310MailREC1] & '#mailto:' & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2310MailREC1], " & _
    "Table01Machines.[REC2] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2311REC2], " & _
    "Table01Machines.[TelREC2] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2312TelREC2], " & _
    "Table01Machines.[InterneREC2] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2313InterneREC2], " & _
    "Table01Machines.[MailREC2] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2314MailREC2] & '#mailto:' & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2314MailREC2], " & _
    "Table01Machines.[RDoc] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2315RDoc], " & _
    "Table01Machines.[TelRDoc] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2316TelRDoc], " & _
    "Table01Machines.[InterneRDoc] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2317InterneRDoc], " & _
    "Table01Machines.[MailRDoc] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2318MailRDoc] & '#mailto:' & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2318MailRDoc], " & _
    "Table01Machines.[RTech] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2319RTech], " & _
    "Table01Machines.[TelRTech] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2320TelRTech], " & _
    "Table01Machines.[InterneRTech] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2321InterneRTech], " & _
    "Table01Machines.[MailRTech] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2322MailRTech] & '#mailto:' & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2322MailRTech], " & _
    "Table01Machines.[LogAssocie] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2323LogAssocie], " & _
    "Table01Machines.[Demandeur] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2324Demandeur], " & _
    "Table01Machines.[Fournisseur] = Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2325Fournisseur] " & _
    "WHERE Table01Machines.[N°] = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
     
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2310MailREC1].[Value]) Or Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2310MailREC1].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailREC1] = '' WHERE Table01Machines.N° = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
    End If
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2314MailREC2].[Value]) Or Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2314MailREC2].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailREC2] = '' WHERE Table01Machines.N° = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
    End If
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2318MailRDoc].[Value]) Or Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2318MailRDoc].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailRDoc] = '' WHERE Table01Machines.N° = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
    End If
     
    If IsNull(Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2322MailRTech].[Value]) Or Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2322MailRTech].[Value] = "" Then
    DoCmd.RunSQL " UPDATE Table01Machines SET [MailRTech] = '' WHERE Table01Machines.N° = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
    End If
     
     
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Nom, Prenom FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1])
    r2.MoveFirst
     
    Dim Str As String
     
    Str = "Machine : " & Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2302Categorie] & " (N° : " & Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3] & ")"
     
    DoCmd.RunSQL " INSERT INTO Table05HistoriqueModifications ([Date], [Heure], [TypeAction], [Detail], [Technicien]) VALUES (Date(), Time(), ""Modification d'une machine"", """ & Str & """,""" & r2.Fields(1).Value & " " & r2.Fields(0).Value & """);"
     
     
    DoCmd.RunSQL "Delete Table01Machines.pictogrammes.Value FROM Table01Machines WHERE Table01Machines.N° =  Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
     
    Dim i As Integer
    Dim j As Integer
     
    For i = 1 To Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].ListCount
     
    j = Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].ItemData(i - 1)
     
    DoCmd.RunSQL "INSERT INTO Table01Machines ( pictogrammes.[Value] ) VALUES (" & CStr(j) & ") WHERE Table01Machines.N° =  Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3];"
     
    Next
     
    DoCmd.SetWarnings True
     
    MsgBox "Les champs de texte et les pictogrammes de la machine """ & r.Fields(0).Value & """ ont été mis à jour."
     
    End If
     
    End Function
     
    Public Function maFonction1411AfterUpdate()
     
    Forms![Formulaire204ModifierMachine]![Controle1414Liste].Requery
     
    End Function
     
    Public Function maFonction1413Click()
     
    Forms![Formulaire204ModifierMachine]![Controle1414Liste].Requery
     
    End Function
     
    Public Function maFonction1414Click()
     
    'Sélection d'un élément de la liste affichant le résultat de la recherche (Liste16), en fonction du texte dans le champ Texte3 :
     
    'Rangement du numéro d'identification de la machine sélectionnée dans le champ Texte18 (invisible) :
    Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3] = Forms![Formulaire204ModifierMachine]![Controle1414Liste].Column(0)
     
    Dim k As Integer
     
    For k = 1 To Forms![Formulaire204ModifierMachine]![Controle1405Liste].ListCount
    Forms![Formulaire204ModifierMachine]![Controle1405Liste].RemoveItem (0)
    Next k
     
    For k = 1 To Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].ListCount
    Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].RemoveItem (0)
    Next k
     
     
    Dim Str As String
    Str = ""
     
    'Création d'un set (r2) contenant les numéros d'identification des pictogrammes de la machine considérée à l'aide du champ Texte14 :
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Pictogrammes.Value FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3] & ";")
     
    'Verification que le set r2 est non vide :
    If Not r2.EOF Then
     
      r2.MoveFirst
     
      Dim m As Integer
      m = 0
     
      While Not r2.EOF
      m = m + 1
      r2.MoveNext
      Wend
     
      r2.MoveFirst
     
      'Verification que la première cellule du set r2 contient bien un pictogramme :
      If Not r2.Fields(0).Value = "" Then
     
        'Création d'un set (r) contenant une seule valeur, celle du pictogramme courant de la boucle, correspondant au numéro d'identification
        'contenu dans la cellule courante du set r2 :
        Dim r As DAO.Recordset
     
        'Parcours des pictogrammes de r2 à l'aide d'une boucle :
        For i = 0 To m - 1
     
          'Verification qu'il reste des pictogramme dans r2 :(*)
          If Not r2.EOF Then
            'Affectation de la valeur courante de r :
            Set r = CurrentDb.OpenRecordset("SELECT Table02Pictogrammes.Description FROM Table02Pictogrammes WHERE Table02Pictogrammes.N°= " & r2.Fields(0) & ";")
            'Selection de la cellule de r :
            r.MoveFirst
     
             Forms![Formulaire204ModifierMachine]![Controle1405Liste].AddItem (CStr(r2.Fields(0).Value) + " " + CStr(r.Fields(0).Value))
            Forms![Formulaire204ModifierMachine]![Controle1406ListeCache1].AddItem (r2.Fields(0).Value)
            If Str = "" Then
            Str = r2.Fields(0).Value
            Else
            Str = Str + "; " + CStr(r2.Fields(0).Value)
            End If
     
     
            r2.MoveNext
          End If
     
        Next i
     
      End If
    End If
     
    Forms![Formulaire204ModifierMachine]![Controle1408TexteCache1] = Str
     
    ''''''''''''''''''''Forms![Formulaire204ModifierMachine]![Requête10].Requery
    Forms![Formulaire204ModifierMachine]![Controle1415SousForm2].Requery
     
    Dim r3 As DAO.Recordset
    Set r3 = CurrentDb.OpenRecordset("SELECT [Appartenance], [Categorie], [CarPrincipales], [Batiment], [Service], [Salle], [REC1], [TelREC1], [InterneREC1], [MailREC1], [REC2], [TelREC2], [InterneREC2], [MailREC2], [RDoc], [TelRDoc], [InterneRDoc], [MailRDoc], [RTech], [TelRTech], [InterneRTech], [MailRTech], [LogAssocie], [Demandeur], [Fournisseur] FROM Table01Machines WHERE Table01Machines.N°=" & Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3] & ";")
    r3.MoveFirst
     
     
    Set r01 = CurrentDb.OpenRecordset("SELECT Intitule FROM Table31Appartenance WHERE N° = " & CStr(r3.Fields(0).Value))
    r01.MoveFirst
    Set r02 = CurrentDb.OpenRecordset("SELECT Intitule FROM Table32Batiment WHERE N° = " & CStr(r3.Fields(3).Value))
    r02.MoveFirst
    Set r03 = CurrentDb.OpenRecordset("SELECT Intitule FROM Table33Service WHERE N° = " & CStr(r3.Fields(4).Value))
    r03.MoveFirst
    Set r04 = CurrentDb.OpenRecordset("SELECT Intitule FROM Table34Salle WHERE N° = " & CStr(r3.Fields(5).Value))
    r04.MoveFirst
     
     
    'Dim b1 As Integer
    'b1 = InStr(1, r3.Fields(9).Value, "#mailto:")
    'If b1 > 1 Then
    'Dim a1 As String
    'a1 = Left(r3.Fields(9).Value, b1 - 1)
    'End If
     
    Dim b1 As Integer
    Dim a1 As String
    If Not IsNull(r3.Fields(9).Value) Then
    b1 = InStr(1, r3.Fields(9).Value, "#mailto:")
    If b1 > 1 Then
    a1 = Left(r3.Fields(9).Value, b1 - 1)
    Else: a1 = ""
    End If
    Else: a1 = ""
    End If
     
     
    Dim b2 As Integer
    Dim a2 As String
    If Not IsNull(r3.Fields(13).Value) Then
    b2 = InStr(1, r3.Fields(13).Value, "#mailto:")
    If b2 > 1 Then
    a2 = Left(r3.Fields(13).Value, b2 - 1)
    Else: a2 = ""
    End If
    Else: a2 = ""
    End If
     
     
    Dim b3 As Integer
    Dim a3 As String
    If Not IsNull(r3.Fields(17).Value) Then
    b3 = InStr(1, r3.Fields(17).Value, "#mailto:")
    If b3 > 1 Then
    a3 = Left(r3.Fields(17).Value, b3 - 1)
    Else: a3 = ""
    End If
    Else: a3 = ""
    End If
     
     
    Dim b4 As Integer
    Dim a4 As String
    If Not IsNull(r3.Fields(21).Value) Then
    b4 = InStr(1, r3.Fields(21).Value, "#mailto:")
    If b4 > 1 Then
    a4 = Left(r3.Fields(21).Value, b4 - 1)
    Else: a4 = ""
    End If
    Else: a4 = ""
    End If
     
     
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2301Appartenance] = r01.Fields(0).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2302Categorie] = r3.Fields(1).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2303CarPrincipales] = r3.Fields(2).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2304Batiment] = r02.Fields(0).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2305Service] = r03.Fields(0).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2306Salle] = r04.Fields(0).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2307REC1] = r3.Fields(6).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2308TelREC1] = r3.Fields(7).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2309InterneREC1] = r3.Fields(8).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2310MailREC1] = a1
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2311REC2] = r3.Fields(10).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2312TelREC2] = r3.Fields(11).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2313InterneREC2] = r3.Fields(12).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2314MailREC2] = a2
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2315RDoc] = r3.Fields(14).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2316TelRDoc] = r3.Fields(15).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2317InterneRDoc] = r3.Fields(16).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2318MailRDoc] = a3
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2319RTech] = r3.Fields(18).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2320TelRTech] = r3.Fields(19).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2321InterneRTech] = r3.Fields(20).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2322MailRTech] = a4
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2323LogAssocie] = r3.Fields(22).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2324Demandeur] = r3.Fields(23).Value
    Forms![Formulaire204ModifierMachine]![Controle1402SousForm1]![Controle2325Fournisseur] = r3.Fields(24).Value
     
    Dim j As Integer
    j = Forms![Formulaire204ModifierMachine]![Controle1416TexteCache3]
     
    'Forms![Formulaire204ModifierMachine]![Controle1417SousForm3].Form.Recordset.AbsolutePosition = 0
     
    'While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3].Form.Recordset.N° <> j
    'Forms![Formulaire204ModifierMachine]![Controle1417SousForm3].Form.Recordset.MoveNext
    'Wend
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2403PJ1].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2403PJ1].Form.Recordset.N° <> j
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2403PJ1].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2404PJ2].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2404PJ2].Form.Recordset.N° <> j
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2404PJ2].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2405PJ3].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2405PJ3].Form.Recordset.N° <> j
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2405PJ3].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2406PJ4].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2406PJ4].Form.Recordset.N° <> j
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2406PJ4].Form.Recordset.MoveNext
    Wend
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2407PJ5].Form.Recordset.AbsolutePosition = 0
     
    While Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2407PJ5].Form.Recordset.N° <> j
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2407PJ5].Form.Recordset.MoveNext
    Wend
     
     
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3]![Controle2402Nom].Caption = r3.Fields(1).Value
    Forms![Formulaire204ModifierMachine]![Controle1417SousForm3].Visible = True
     
    End Function
     
    Public Function maFonction1502Click()
     
    DoCmd.Close acForm, "Formulaire205ModifierEtatMachine"
     
    End Function
     
    Public Function maFonction1503AfterUpdate()
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
     
    End Function
     
    Public Function maFonction1505Click()
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
     
    End Function
     
    Public Function maFonction1506Click()
     
    Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] = Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Column(0)
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Requête102].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1507SousForm].Requery
     
    End Function
     
    Public Function maFonction1509Click()
     
     
    If IsNull(Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Categorie FROM Table01Machines WHERE Table01Machines.N° = " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ";")
    r.MoveFirst
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "UPDATE Table01Machines SET Table01Machines.disponibilite = 1  WHERE Table01Machines.N° =  Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1];"
     
     
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Nom, Prenom FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1])
    r2.MoveFirst
     
    Dim Str As String
     
    Str = "Machine : " & r.Fields(0).Value & " (N° : " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ") OPERATIONNELLE"
     
    DoCmd.RunSQL " INSERT INTO Table05HistoriqueModifications ([Date], [Heure], [TypeAction], [Detail], [Technicien]) VALUES (Date(), Time(), ""Modification de l'état d'une machine"", """ & Str & """,""" & r2.Fields(1).Value & " " & r2.Fields(0).Value & """);"
     
     
     
    DoCmd.SetWarnings True
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
     
    MsgBox "La machine """ & r.Fields(0).Value & """ est maintenant considérée comme opérationnelle."
     
    End If
     
    End Function
     
    Public Function maFonction1510Click()
     
    If IsNull(Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Categorie FROM Table01Machines WHERE Table01Machines.N° = " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ";")
    r.MoveFirst
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "UPDATE Table01Machines SET Table01Machines.disponibilite = 3 WHERE Table01Machines.N° =  Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1];"
     
     
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Nom, Prenom FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1])
    r2.MoveFirst
     
    Dim Str As String
     
    Str = "Machine : " & r.Fields(0).Value & " (N° : " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ") INDISPONIBLE"
     
    DoCmd.RunSQL " INSERT INTO Table05HistoriqueModifications ([Date], [Heure], [TypeAction], [Detail], [Technicien]) VALUES (Date(), Time(), ""Modification de l'état d'une machine"", """ & Str & """,""" & r2.Fields(1).Value & " " & r2.Fields(0).Value & """);"
     
     
     
     
     
    DoCmd.SetWarnings True
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
     
    MsgBox "La machine """ & r.Fields(0).Value & """ est maintenant considérée comme indisponible."
     
    End If
     
    End Function
     
    Public Function maFonction1511Click()
     
    If IsNull(Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Categorie FROM Table01Machines WHERE Table01Machines.N° = " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ";")
    r.MoveFirst
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "UPDATE Table01Machines SET Table01Machines.disponibilite = 4 WHERE Table01Machines.N° =  Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1];"
     
     
     
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT Nom, Prenom FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1])
    r2.MoveFirst
     
    Dim Str As String
     
    Str = "Machine : " & r.Fields(0).Value & " (N° : " & Forms![Formulaire205ModifierEtatMachine]![Controle1508TexteCache1] & ") ABANDONNEE"
     
    DoCmd.RunSQL " INSERT INTO Table05HistoriqueModifications ([Date], [Heure], [TypeAction], [Detail], [Technicien]) VALUES (Date(), Time(), ""Modification de l'état d'une machine"", """ & Str & """,""" & r2.Fields(1).Value & " " & r2.Fields(0).Value & """);"
     
     
    DoCmd.SetWarnings True
     
     
    ''''''''''''''''''''Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
    Forms![Formulaire205ModifierEtatMachine]![Controle1506Liste].Requery
     
    MsgBox "La machine """ & r.Fields(0).Value & """ est maintenant considérée comme abandonnée."
     
    End If
     
    End Function
     
    Public Function maFonction1602Click()
     
    Dim Str As String
    Dim Str2 As String
    Dim Str3 As String
     
    Str = OuvrirUnFichier(Application.hWndAccessApp, "Parcourir", 1)
    Str2 = Filename(Str)
    Str3 = FileExt(Str)
     
    If Str3 <> "jpg" And Str3 <> "png" And Str3 <> "bmp" Then
    MsgBox "Vous ne pouvez choisir que des fichiers au format "".jpg"", "".png"", ou "".bmp""."
     
    Else
     
    Forms![Formulaire206AjouterPictogramme]![Controle1604Nom].Caption = Str
    Forms![Formulaire206AjouterPictogramme]![Controle1603Chemin].Caption = Str2
     
    Forms![Formulaire206AjouterPictogramme]![Controle1605Image].Picture = Str
     
    End If
     
     
    End Function
     
    Public Function maFonction1608Click()
     
    If IsNull(Forms![Formulaire206AjouterPictogramme]![Controle1603Chemin].Caption) Or Forms![Formulaire206AjouterPictogramme]![Controle1603Chemin].Caption = "/" Then
     
    MsgBox "Vous devez d'abord choisir une image."
     
    Else
     
     
    Dim objShell As Shell
    Dim objFolder As Folder
     
    Set objShell = New Shell
    Set objFolder = objShell.BrowseForFolder(0, "Enregistrer sous", 0, "S:\Z_Archive Fichiers et Dossiers\Base principal\" & "\Pictogrammes sécurités")
     
    If Not objFolder Is Nothing Then
     
    objFolder.CopyHere Forms![Formulaire203=6AjouterPictogramme]![Controle1604Nom].Caption
     
    Dim NewPath As String
    Dim RelativeNewPath As String
     
    NewPath = objFolder.ParentFolder.ParseName(objFolder.Title).Path & "\" & Forms![Formulaire206AjouterPictogramme]![Controle1603Chemin].Caption
    RelativeNewPath = Replace(NewPath, "S:\Z_Archive Fichiers et Dossiers\Base principal\", "")
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL "INSERT INTO Table02Pictogrammes (Chemin, Description) VALUES ('" & RelativeNewPath & "', Forms![Formulaire206AjouterPictogramme]![Controle1606Description].[Value]);"
     
    DoCmd.SetWarnings True
     
    maFonctionReinitialisationPictogrammes
     
    MsgBox " Le pictogramme """ & Forms![Formulaire206AjouterPictogramme]![Controle1606Description].[Value] & """ a été ajouté à la collection, et peut maintenant être utilisé dans les formulaires ""Ajouter une machine"" et ""Modifier une machine""."
     
    DoCmd.Close acForm, "Formulaire206AjouterPictogramme"
     
    End If
     
    End If
     
    End Function
     
    Public Function maFonction1702AfterUpdate()
     
    ''''''''''''''''''''Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Requery
    Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Requery
     
    End Function
     
    Public Function maFonction1704Click()
     
    'Bouton de lancement de la recherche :
     
    'Actualisation de l'état de la liste affichant le résultat de la recherche (Liste20), en fonction du texte dans le champ Texte0 :
    Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Requery
     
    'Effacement de la dernière sélection dans la Liste20, stockée dans le champ Texte5 (invisible):
    Forms![Formulaire207ModifierPictogramme]![Controle1707TexteCache1] = ""
     
    'Effacement de l'état de la Requête7, en la mettant à jour :
    ''''''''''''''''''''Forms![Formulaire207ModifierPictogramme]![Requête7].Requery
    Forms![Formulaire207ModifierPictogramme]![Controle1706SousForm].Requery
     
    'Effacement du pictogramme dans l'emplacement Image4 :
    Forms![Formulaire207ModifierPictogramme]![Controle1708Image].Picture = "S:\Z_Archive Fichiers et Dossiers\Base principal\" & "\blank.jpg"
     
    'Effacement de la description
    Forms![Formulaire207ModifierPictogramme]![Controle1709Description] = ""
     
    End Function
     
    Public Function maFonction1705Click()
     
    'Selection d'un pictogramme dans la Liste20 :
     
    'On stocke le numéro d'identification du pictogramme dans le champs invisible Texte5 :
    Forms![Formulaire207ModifierPictogramme]![Controle1707TexteCache1] = Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Column(0)
     
    'On affiche le nom du pictogramme dans l'état de la Requête7, en la mettant à jour :
    ''''''''''''''''''''Forms![Formulaire207ModifierPictogramme]![Requête7].Requery
    Forms![Formulaire207ModifierPictogramme]![Controle1706SousForm].Requery
     
    'On affiche le pictogramme dans l'emplacement Image4 :
    Forms![Formulaire207ModifierPictogramme]![Controle1708Image].Picture = "S:\Z_Archive Fichiers et Dossiers\Base principal\" & Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Column(1)
     
     
    'On affiche la description actuelle du pictogramme choisi dans le champ modifiable Texte7 :
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT description FROM Table02Pictogrammes WHERE Table02Pictogrammes.N° = " & Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Column(0))
    Forms![Formulaire207ModifierPictogramme]![Controle1709Description] = r.Fields(0).Value
    r.Close
     
    End Function
     
    Public Function maFonction1711Click()
     
    'Bouton de mise à jour de la description :
     
    'Si aucun pictogramme n'est selectionné, un message est envoyé à l'utilisateur :
    If Forms![Formulaire207ModifierPictogramme]![Controle1707TexteCache1] = "" Then
     
    MsgBox "Vous devez selectionner un pictogramme dans la liste pour modifier sa description."
     
    'Dans le cas contraire, la description est mise à jour relativement au champ Texte7, et au pictogramme choisi dans la Liste20 :
    Else
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL " UPDATE Table02Pictogrammes SET Description = '" & Forms![Formulaire207ModifierPictogramme]![Controle1709Description].[Value] & "' WHERE Table02Pictogrammes.N° = " & Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Column(0) & ";"
     
    DoCmd.SetWarnings True
     
    'Un message est envoyé à l'utilisateur pour lui signifier que l'opération a bien eu lieu :
    MsgBox " La description de """ & Forms![Formulaire207ModifierPictogramme]![Controle1705Liste].Column(1) & """ a été mise à jour. "
     
    DoCmd.Close acForm, "Formulaire207ModifierPictogramme"
     
    End If
     
     
    End Function
     
    Public Function maFonction1802Click()
     
    DoCmd.Close acForm, "Formulaire208DetailReservation"
     
    End Function
     
    Public Function maFonction1803AfterUpdate()
     
    Forms![Formulaire208DetailReservation]![Controle1806Liste].Requery
     
    End Function
     
    Public Function maFonction1805Click()
     
    Forms![Formulaire208DetailReservation]![Controle1806Liste].Requery
     
    End Function
     
    Public Function maFonction1806Click()
     
    Forms![Formulaire208DetailReservation]![Controle1808TexteCache1] = Forms![Formulaire208DetailReservation]![Controle1806Liste].Column(0)
     
    ''''''''''''''''''''Forms![Formulaire208DetailReservation]![Requête10].Requery
    Forms![Formulaire208DetailReservation]![Controle1807SousForm].Requery
     
    End Function
     
    Public Function maFonction1809Click()
     
     
    If IsNull(Forms![Formulaire208DetailReservation]![Controle1808TexteCache1]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche."
     
    Else
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("Select Categorie From Table01Machines Where N° = " & Forms![Formulaire208DetailReservation]![Controle1808TexteCache1].[Value] & ";")
    r.MoveFirst
     
     
    ''''''''''''''''''''DoCmd.OpenReport "Requête16", acViewReport, , , acWindowNormal
    '''DoCmd.OpenQuery "Requete18Controle1809Historique1", acViewNormal, acReadOnly
    DoCmd.OpenForm "Formulaire302Requete18"
    ''''''''''''''''''''Reports![Requête16]![Étiquette70].Caption = "Historique complet de l'utilisation de la machine : " & r.Fields(0).Value
     
    End If
     
    End Function
     
    Public Function maFonction1810GotFocus()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire208DetailReservation]![Controle1810Mois1].ListCount
    Forms![Formulaire208DetailReservation]![Controle1810Mois1].RemoveItem (0)
    Next i
     
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N°, Mois FROM Table21Mois;")
    r.MoveFirst
     
    While Not r.EOF
    Forms![Formulaire208DetailReservation]![Controle1810Mois1].AddItem (r.Fields(1).Value)
    r.MoveNext
    Wend
     
    Dim j As Integer
    j = 0
     
    Dim m As Integer
    m = 0
     
     
    If Forms![Formulaire208DetailReservation]![Controle1811Annee1].Value = Forms![Formulaire208DetailReservation]![Controle1813Annee2].Value Then
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1812Mois2] & "';")
     
    If Not r2.EOF Then
    r2.MoveFirst
    m = 12 - r2.Fields(0).Value
     
    End If
    End If
     
    j = m
     
    If j <> 0 Then
     
    For i = 1 To j
    Forms![Formulaire208DetailReservation]![Controle1810Mois1].RemoveItem (Forms![Formulaire208DetailReservation]![Controle1810Mois1].ListCount - 1)
    Next i
    End If
     
    End Function
     
     
    Public Function maFonction1811GotFocus()
     
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire208DetailReservation]![Controle1811Annee1].ListCount
    Forms![Formulaire208DetailReservation]![Controle1811Annee1].RemoveItem (0)
    Next i
     
     
    Dim j As Integer
     
    If IsNull(Forms![Formulaire208DetailReservation]![Controle1813Annee2]) Or (Forms![Formulaire208DetailReservation]![Controle1813Annee2] = "") Then
    j = Year(Date) - 2014 + 1
    Else
    j = Forms![Formulaire208DetailReservation]![Controle1813Annee2].Value - 2014
    End If
     
     
     
    For i = 1 To j
    Forms![Formulaire208DetailReservation]![Controle1811Annee1].AddItem (CStr(2014 + i))
     
    Next i
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1810Mois1] & "';")
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1812Mois2] & "';")
     
    If Not r.EOF And Not r2.EOF Then
    r.MoveFirst
    r2.MoveFirst
     
    If r.Fields(0).Value > r2.Fields(0).Value Then
    Forms![Formulaire208DetailReservation]![Controle1811Annee1].RemoveItem (Forms![Formulaire208DetailReservation]![Controle1811Annee1].ListCount - 1)
    End If
     
    End If
     
    End Function
     
     
    Public Function maFonction1812GotFocus()
     
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire208DetailReservation]![Controle1812Mois2].ListCount
    Forms![Formulaire208DetailReservation]![Controle1812Mois2].RemoveItem (0)
    Next i
     
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N°, Mois FROM Table21Mois;")
    r.MoveFirst
     
    While Not r.EOF
    Forms![Formulaire208DetailReservation]![Controle1812Mois2].AddItem (r.Fields(1).Value)
    r.MoveNext
    Wend
     
    If Forms![Formulaire208DetailReservation]![Controle1811Annee1].Value = Forms![Formulaire208DetailReservation]![Controle1813Annee2].Value Then
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1810Mois1] & "';")
     
    If Not r2.EOF Then
    r2.MoveFirst
     
    If r2.Fields(0).Value > 1 Then
     
    For i = 1 To r2.Fields(0).Value - 1
    Forms![Formulaire208DetailReservation]![Controle1812Mois2].RemoveItem (0)
    Next i
     
    End If
    End If
    End If
     
     
    End Function
     
    Public Function maFonction1813GotFocus()
     
    Dim i As Integer
     
    For i = 1 To Forms![Formulaire208DetailReservation]![Controle1813Annee2].ListCount
    Forms![Formulaire208DetailReservation]![Controle1813Annee2].RemoveItem (0)
    Next i
     
     
    Dim k As Integer
    If IsNull(Forms![Formulaire208DetailReservation]![Controle1811Annee1]) Or (Forms![Formulaire208DetailReservation]![Controle1811Annee1] = "") Then
    k = 2015
    Else
    k = Forms![Formulaire208DetailReservation]![Controle1811Annee1].Value
    End If
     
    Dim j As Integer
    j = Year(Date) - k + 2
     
     
    For i = 1 To j
    Forms![Formulaire208DetailReservation]![Controle1813Annee2].AddItem (CStr(k - 1 + i))
    Next i
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1810Mois1] & "';")
     
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1812Mois2] & "';")
     
    If Not r.EOF And Not r2.EOF Then
    r.MoveFirst
    r2.MoveFirst
     
    If r2.Fields(0).Value < r.Fields(0).Value Then
    Forms![Formulaire208DetailReservation]![Controle1813Annee2].RemoveItem (0)
    End If
     
    End If
     
     
    End Function
     
    Public Function maFonction1818Click()
     
     
    If IsNull(Forms![Formulaire208DetailReservation]![Controle1808TexteCache1]) Then
     
    MsgBox "Vous devez d'abord choisir une machine en utilisant le moteur de recherche."
     
    Else
     
    If IsNull(Forms![Formulaire208DetailReservation]![Controle1810Mois1]) _
    Or IsNull(Forms![Formulaire208DetailReservation]![Controle1811Annee1]) _
    Or IsNull(Forms![Formulaire208DetailReservation]![Controle1812Mois2]) _
    Or IsNull(Forms![Formulaire208DetailReservation]![Controle1813Annee2]) Then
     
    MsgBox "Vous devez remplir tous les champs de date."
     
    Else
     
     
    Dim MoisDébut As String
    Dim MoisFin As String
    Dim AnnéeDébut As String
    Dim AnnéeFin As String
     
    Dim r As DAO.Recordset
    Set r = CurrentDb.OpenRecordset("SELECT Table21Mois.N° FROM Table21Mois WHERE Table21Mois.Mois = '" & Forms![Formulaire208DetailReservation]![Controle1810Mois1].[Value] & "';")
    r.MoveFirst
    Dim r2 As DAO.Recordset
    Set r2 = CurrentDb.OpenRecordset("SELECT N° FROM Table21Mois WHERE Mois = '" & Forms![Formulaire208DetailReservation]![Controle1812Mois2].[Value] & "';")
    r2.MoveFirst
     
    MoisDébut = r.Fields(0).Value
    MoisFin = r2.Fields(0).Value + 1
    AnnéeDébut = Forms![Formulaire208DetailReservation]![Controle1811Annee1].[Value]
    AnnéeFin = Forms![Formulaire208DetailReservation]![Controle1813Annee2].[Value]
     
    If MoisFin = 13 Then
    MoisFin = 1
    AnnéeFin = AnnéeFin + 1
    End If
     
     
    Dim DateDébut As Date
    Dim DateFin As Date
     
    DateDébut = "01/" & MoisDébut & "/" & AnnéeDébut
    DateFin = "01/" & MoisFin & "/" & AnnéeFin
     
    Forms![Formulaire208DetailReservation]![Controle1816TexteCache2] = DateDébut
    Forms![Formulaire208DetailReservation]![Controle1817TexteCache3] = DateFin
     
    Dim r3 As DAO.Recordset
    Set r3 = CurrentDb.OpenRecordset("Select Categorie From Table01Machines Where N° = " & Forms![Formulaire208DetailReservation]![Controle1808TexteCache1].[Value] & ";")
    r3.MoveFirst
     
    ''''''''''''''''''''DoCmd.OpenReport "Requête162", acViewReport, , , acWindowNormal
    ''''DoCmd.OpenQuery "Requete19Controle1818Historique2", acViewNormal, acReadOnly
    DoCmd.OpenForm "Formulaire303Requete19"
    ''''''''''''''''''''Reports![Requête162]![Auto_EnTete0].Caption = "Historique de l'utilisation de la machine : " & r3.Fields(0).Value & ", entre le début du mois " & Forms![Formulaire208DetailReservation]![Controle1810Mois1].[Value] & " " & AnnéeDébut & " et la fin du mois " & Forms![Formulaire208DetailReservation]![Controle1812Mois2].[Value] & " " & Forms![Formulaire208DetailReservation]![Controle1813Annee2].[Value] & "."
     
    End If
    End If
     
    End Function
     
    Public Function maFonction2004Click()
     
    Dim r As DAO.Recordset
     
    Set r = CurrentDb.OpenRecordset("SELECT MDP FROM Table06ComptesTechniciens WHERE N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1].Value & ";")
     
    r.MoveFirst
     
    If Not Forms![Formulaire210ChangementMDP1]![Controle2002MDP] = r.Fields(0).Value Or IsNull(Forms![Formulaire210ChangementMDP1]![Controle2002MDP]) Then
     
    MsgBox "Mot de passe incorrect."
    Forms![Formulaire210ChangementMDP1]![Controle2002MDP] = Null
     
    Else
     
    DoCmd.OpenForm "Formulaire211ChangementMDP2"
     
    DoCmd.Close acForm, "Formulaire210ChangementMDP1"
     
    End If
     
    End Function
     
    Public Function maFonction2104Click()
     
    If IsNull(Forms![Formulaire211ChangementMDP2]![Controle2102MDP]) Then
    MsgBox "Vous devez entrer un nouveau mot de passe."
     
    Else
     
    DoCmd.OpenForm "Formulaire212ChangementMDP3"
     
    Forms![Formulaire212ChangementMDP3]![Controle2205TexteCache1] = Forms![Formulaire211ChangementMDP2]![Controle2102MDP].Value
     
    DoCmd.Close acForm, "Formulaire211ChangementMDP2"
     
    End If
    End Function
     
    Public Function maFonction2204Click()
     
    If Not Forms![Formulaire212ChangementMDP3]![Controle2202MDP] = Forms![Formulaire212ChangementMDP3]![Controle2205TexteCache1].Value Then
    MsgBox "Votre mot de passe est différent de celui donné à l'étape précédente. Vous devez entrer le même."
    Forms![Formulaire212ChangementMDP3]![Controle2202MDP] = Null
     
    Else
     
    DoCmd.SetWarnings False
     
    DoCmd.RunSQL " UPDATE Table06ComptesTechniciens SET MDP = '" & Forms![Formulaire212ChangementMDP3]![Controle2202MDP].[Value] & "' WHERE Table06ComptesTechniciens.N° = " & Forms![Formulaire202GestionInterne]![Controle1214TexteCache1].Value & ";"
     
    DoCmd.SetWarnings True
     
    MsgBox "Votre mot de passe a été changé."
     
    DoCmd.Close acForm, "Formulaire212ChangementMDP3"
     
    End If
     
    End Function
    Merci pour votre aide

  5. #5
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    Bonjour à tous,
    merci pour zekrawi, et aussi pour loufab, cette partie de code est dans un module extérieur.
    il me signal des erreurs de non reconnaissance des formulaires dans la plupart des fonctions
    Merci pour votre aide

  6. #6
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Si cette ligne ne fonctionne pas :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    DoCmd.OpenForm "Formulaire101Recherche"
    Vérifier que le formulaire porte bien ce nom. Si c'est le cas il se peut qu'il y ai un problème de link entre l'interface et le code. Il faut faire une décompilation/compactage. Voici le lien :

    http://blogaccess.free.fr/?p=75

    Si c'est ce type d'instruction qui ne fonctionne pas :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     Forms![Formulaire101Recherche]![Controle0205Liste].Column(0)
    Essayer avec cette syntaxe :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     Forms("Formulaire101Recherche").controls("Controle0205Liste")].Column(0)
    Le nommage est assez... inhabituel.
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  7. #7
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    bonjour et merci loufab pour votre réponse rapide,
    pour le nom du formulaire est bien Formulaire101Recherche, j'ai essayer avec
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Forms("Formulaire101Recherche").controls("Controle0205Liste").Column(0)
    , il ma écrit " access ne trouve pas le Formulaire101Recherche aux quel il faut référence ".
    une question s'il vous plait : le patch je le mis ou et comment?, j'ai lu l'article mais j'ai pas trés bien compris
    Merci

  8. #8
    Membre émérite Avatar de Zekraoui_Jakani
    Homme Profil pro
    Inscrit en
    Novembre 2013
    Messages
    1 670
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Novembre 2013
    Messages : 1 670
    Points : 2 489
    Points
    2 489
    Par défaut formulaires
    J'aimerai bien 1 copie (zip) de ta DB pour la faire tourner et essayer de repérer l'erreur.

  9. #9
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    bonjour Mr zekraoui,
    merci pour votre proposition d'aide, mais ma DB est confidentiel.
    cordialement.

  10. #10
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Concernant le batch et non le patch, il faut copier le .bat dans le répertoire de l'application.
    Maintenir la touche Shift enfoncée pour éviter à l'application de démarrer.
    Sélectionner le fichier accdb de ton appli et la faire glisser sur le batch.
    Il va ouvrir une première fois l'appli sans la lancer, il faut la refermer puis il va la lancer une 2ème fois pour le compactage.
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  11. #11
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    Bonjour,
    Merci loufab, j'ai suivi tes recommandations et j'ai glisser ma DB dans le fichier .bat avec l'appui sur la touche Shift, il à ouvert ma DB et aussi un écran d’exécution + un autre fichier .Sav, j'ai fermer ma DB et je l'es ré-ouverte une deuxième fois, je pense qu'il à compacter.
    maintenant comment je puise savoir que toutes est bon s'il vous plait?.

  12. #12
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Si c'était un problème de link VBA/IHM l'application devrait fonctionner.
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  13. #13
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    ok, merci loufab, une dernière question s'il vous plait : mon application marche bien sauf que il y a le module fonction Event qui bug est il connaît pas les formulaires?
    est ce que c'est normal?
    cordialement.

  14. #14
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Ce que je tenterais, car visiblement cette base est endommagée :

    Exporter le code concerné, supprimer le module, faire un decomp/comp à nouveau, vérifier dans un éditeur type notepad++ que ce code ne contient pas de caractère de contrôle puis reimporter le code.

    Si la fonction se nomme Event j'en changerais, il me semble que c'est un nom réservé (à vérifier).
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  15. #15
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    re loufab,
    quel extension sur le Notepad++, et comment je peux vérifier les caractère de contrôle? s'il vous plait
    cordialement.

  16. #16
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Peut importe l'extension, c'est un éditeur de texte et il ne doit y avoir que du texte. Pour controler ça il faut cliquer sur l'icone P à l'envers (symbole du paragraphe sous word). Il ne doit y avoir que des CR LF. Si il n'y a que CR ou que LF ou autre chose à il faut le supprimer.
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  17. #17
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    j'ai vérifier le module sur Notepad + l'inverse de P, il y a les CR LF ensemble dans toutes les lignes.
    cordialement.

  18. #18
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Donc c'est bon.

    La question peut paraitre idiote mais tu compiles ton code de temps en temps ?
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  19. #19
    Nouveau membre du Club Avatar de Adel31
    Homme Profil pro
    Consultant ERP
    Inscrit en
    Février 2016
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultant ERP
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2016
    Messages : 57
    Points : 32
    Points
    32
    Par défaut
    Bonjour loufab,
    merci pour votre aide

  20. #20
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    12 006
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 12 006
    Points : 24 598
    Points
    24 598
    Par défaut
    Le problème venait d'où ?
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Bug dans un code la FAQ VBA?
    Par grafikm_fr dans le forum Contribuez
    Réponses: 3
    Dernier message: 14/06/2011, 21h01
  2. [Tableaux] Bug dans un code perso
    Par tom06440 dans le forum Langage
    Réponses: 1
    Dernier message: 02/07/2006, 12h38
  3. [Vba-E]Bug dans mon code
    Par antoinelavigne dans le forum Macros et VBA Excel
    Réponses: 9
    Dernier message: 19/06/2006, 14h55
  4. Réponses: 2
    Dernier message: 03/05/2006, 08h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo