Qui peut m'aider a traduire du code

kortecs94 Messages postés 20 Date d'inscription jeudi 10 mai 2007 Statut Membre Dernière intervention 20 juillet 2007 - 16 mai 2007 à 16:42
jrivet Messages postés 7392 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 6 avril 2012 - 16 mai 2007 à 16:51
j'essaie de comprendre un code associé a un formulaire sous Access
quelqu'un sait-t-il ce que chaque ligne signifie

merci a tous

Private Sub Form_Open(Cancel As Integer)


' Minimize the database window and initialize the form.
    Dim fs, f, f1, fc
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder("c:")
    Set fc = f.Files
   
    ma_date = Date
    n = Weekday(Date)
   
    If Weekday(Date) = 1 Then
       
        Set fs = CreateObject("Scripting.FileSystemObject")
        If fs.FileExists("C:\LogAB.txt") = True Then
       
        DoCmd.RunMacro "Import Complet", , ""
       
        Set fs = CreateObject("Scripting.FileSystemObject")
        fs.DeleteFile "C:\LogAB.txt"
        Quit
       
        End If
    End If
 
End Sub

1 réponse

jrivet Messages postés 7392 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 6 avril 2012 60
16 mai 2007 à 16:51
'a l'ouverture du Formulaire

Private Sub Form_Open(Cancel As Integer)

' Minimize the database window and initialize the form.
   Dim fs, f, f1, fc
   'Creation d'un objet FileSystemObject
   Set fs = CreateObject("Scripting.FileSystemObject")
   'affectation à f d'un objet Folder representant C:\
   Set f = fs.GetFolder("c:\")
   'affectation à fc de la collection de fichier de f
   'soit les fichiers de C:\
   Set fc = f.Files
 
   'ma_date = aujourdui
   ma_date = Date
   'n = numero du jour de la semaine
   'attention premier jour ici dimanche
   n = Weekday(Date)
    'si weekday 1 dimanche
   If Weekday(Date) = 1 Then
       'Creation d'un objet FileSystemObject
       'INUTILE puisque déjà fait plus haut....
       Set fs = CreateObject("Scripting.FileSystemObject")
       'verification de l'existance du fichier C:\LogAB.txt
       If fs.FileExists("C:\LogAB.txt") = True Then
       'Appel de la macro Import Complet
       DoCmd.RunMacro "Import Complet", , ""
       'Creation d'un objet FileSystemObject
       'INUTILE puisque déjà fait plus haut.... BIS
       Set fs = CreateObject("Scripting.FileSystemObject")
       'Efface le fichier C:\LogAB.txt
       fs.DeleteFile "C:\LogAB.txt"
       'sort
       Quit
     
       End If
   End If

End Sub ,

----

Ju£i?n</italique>


Pensez: Réponse acceptée
0
Rejoignez-nous