Il sere protégé par un mot de passe et ne sera pas accessible aux utilisateurs.
Je ne peux donc pas laissé le formulaire PARAMETRE ouvert.
J'ai aussi essayé en laissant ouvert le formulaire mais ca ne marche toujours pas.
Comprends plus rien :bug:
Version imprimable
Il sere protégé par un mot de passe et ne sera pas accessible aux utilisateurs.
Je ne peux donc pas laissé le formulaire PARAMETRE ouvert.
J'ai aussi essayé en laissant ouvert le formulaire mais ca ne marche toujours pas.
Comprends plus rien :bug:
Salut,
Dans ce cas là, utilises une table paramètres avec un seul enregistrement dans laquelle tu stockes tous les paramètres de ton appli.
Table qui peut être mise à jour par ton formulaire Parametre
J'ai deja une table PARAMETRE avec un seul champ "Chemin" .
Alors prend chemin dans ta table
Code:
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 Private Sub Créer_Click() Chemin.Value = Dlookup("Chemin","PARAMETRE") Dim strDirPath As String strDirPath = Chemin.Value & "\" & Numéro.Value & " - " & NAffaire.Value MsgBox strDirPath If Dir(Chemin.Value & Numéro.Value & " - " & NAffaire.Value, vbDirectory) > "" Then MsgBox ("Cette Affaire existe déjà") Else MkDir Chemin.Value & Numéro.Value & " - " & NAffaire.Value End If MkDir Chemin.Value & Numéro.Value & " - " & NAffaire.Value & "\ESQ" MkDir Chemin.Value & Numéro.Value & " - " & NAffaire.Value & "\ESQ\Secrétariat" MkDir Chemin.Value & Numéro.Value & " - " & NAffaire.Value & "\ESQ\Autocad" On Error GoTo Err_Créer_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "AFFAIRE" DoCmd.Close DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Créer_Click: Exit Sub Err_Créer_Click: MsgBox Err.Description Resume Exit_Créer_Click End Sub
J'ai réussis aprés un mois :aie: . Merci beaucoup.
Voilà le code :
Encore une fois merci à vous tous.Code:
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 Private Sub Créer_Click() Chemin = DLookup("Chemin", "PARAMETRE") Dim strDirPath As String strDirPath = Chemin & Numéro.Value & " - " & NAffaire.Value MsgBox strDirPath If Dir(Chemin & Numéro.Value & " - " & NAffaire.Value, vbDirectory) > "" Then MsgBox ("Cette Affaire existe déjà") Else MkDir Chemin & Numéro.Value & " - " & NAffaire.Value End If MkDir Chemin & Numéro.Value & " - " & NAffaire.Value & "\ESQ" MkDir Chemin & Numéro.Value & " - " & NAffaire.Value & "\ESQ\Secrétariat" MkDir Chemin & Numéro.Value & " - " & NAffaire.Value & "\ESQ\Autocad" On Error GoTo Err_Créer_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "AFFAIRE" DoCmd.Close DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Créer_Click: Exit Sub Err_Créer_Click: MsgBox Err.Description Resume Exit_Créer_Click End Sub