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 :

Problème erreur d'exécution 94 utilisation incorrecte null


Sujet :

VBA Access

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 7
    Points : 2
    Points
    2
    Par défaut Problème erreur d'exécution 94 utilisation incorrecte null
    Bonjour,

    Alors je me permets de poster mon problème ici. Je préviens de suite que je ne suis pas un spécialiste du VBA.
    J'ai un problème avec un fichier ACCESS que mon prédécesseur à créé.

    Quand je suis dans un champ pour rentrer des dates, Access me sort "erreur d'exécution 94 utilisation incorrecte null "

    Else
    For i = 1 To [Dleap]
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2

    C'est la ligne en question qui pose problème. Je ne sais pas trop ce qu'il faudrait que je vous mette pour que vous puissiez comprendre d'où viens le problème.
    Le plus bizarre dans tout ça, c'est que cela fonctionnait très bien et d'une saisie à l'autre le problème est apparu...

    Merci d'avance et n'hésitez pas à me demander d'autres informations.

  2. #2
    Expert confirmé
    Avatar de pc75
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    3 662
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Septembre 2004
    Messages : 3 662
    Points : 4 047
    Points
    4 047
    Par défaut
    Bonjour,

    A quoi correspond [Dleap] ?

    Il faudrait un peu plus de code !

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 7
    Points : 2
    Points
    2
    Par défaut
    Merci pour ta réponse rapide.
    J'ai beau chercher, je ne vois pas à quoi cela correspond... Je suis vraiment pas doué en VBA mais c'est surtout que je n'ai pas du tout participé à l'élaboration de cette base...

    Si tu veux du code, j'en ai ^^



    Private Sub EmisReel_Exit(Cancel As Integer)
    If IsDate([EmisReel]) Then
    [EnvoiAppPrev] = [EmisReel]
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    If WeekDay([EnvoiAppPrev]) = 1 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    End If
    If Dleap = 0 Then
    [EnvoiAppReel] = [EnvoiAppPrev]
    Else
    For i = 1 To [Dleap]
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    If Month([EnvoiAppPrev]) = 1 Then
    If Day([EnvoiAppPrev]) = 1 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    If Month([EnvoiAppPrev]) = 5 Then
    If Day([EnvoiAppPrev]) = 1 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    If Month([EnvoiAppPrev]) = 7 Then
    If Day([EnvoiAppPrev]) = 14 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    If Month([EnvoiAppPrev]) = 8 Then
    If Day([EnvoiAppPrev]) = 15 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    If Month([EnvoiAppPrev]) = 11 Then
    If Day([EnvoiAppPrev]) = 11 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    If Month([EnvoiAppPrev]) = 12 Then
    If Day([EnvoiAppPrev]) = 25 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 1
    If WeekDay([EnvoiAppPrev]) = 7 Then
    [EnvoiAppPrev] = [EnvoiAppPrev] + 2
    End If
    End If
    End If
    Next
    End If

    [RetourAppPrev] = [EnvoiAppPrev]
    If [DlApp] = 0 Then
    Else
    For i = 1 To [DlApp]
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    If Month([RetourAppPrev]) = 1 Then
    If Day([RetourAppPrev]) = 1 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    If Month([RetourAppPrev]) = 5 Then
    If Day([RetourAppPrev]) = 1 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    If Month([RetourAppPrev]) = 7 Then
    If Day([RetourAppPrev]) = 14 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    If Month([RetourAppPrev]) = 8 Then
    If Day([RetourAppPrev]) = 15 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    If Month([RetourAppPrev]) = 11 Then
    If Day([RetourAppPrev]) = 11 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    If Month([RetourAppPrev]) = 12 Then
    If Day([RetourAppPrev]) = 25 Then
    [RetourAppPrev] = [RetourAppPrev] + 1
    If WeekDay([RetourAppPrev]) = 7 Then
    [RetourAppPrev] = [RetourAppPrev] + 2
    End If
    End If
    End If
    Next
    End If

    [DateNotifPrev] = [RetourAppPrev]
    If [DlSyn] = 0 Then
    Else
    For i = 1 To [DlSyn]
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    If Month([DateNotifPrev]) = 1 Then
    If Day([DateNotifPrev]) = 1 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    If Month([DateNotifPrev]) = 5 Then
    If Day([DateNotifPrev]) = 1 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    If Month([DateNotifPrev]) = 7 Then
    If Day([DateNotifPrev]) = 14 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    If Month([DateNotifPrev]) = 8 Then
    If Day([DateNotifPrev]) = 15 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    If Month([DateNotifPrev]) = 11 Then
    If Day([DateNotifPrev]) = 11 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    If Month([DateNotifPrev]) = 12 Then
    If Day([DateNotifPrev]) = 25 Then
    [DateNotifPrev] = [DateNotifPrev] + 1
    If WeekDay([DateNotifPrev]) = 7 Then
    [DateNotifPrev] = [DateNotifPrev] + 2
    End If
    End If
    End If
    Next
    End If

    If IsDate([EmisPrev]) Then
    If IsDate([EmisReel]) Then
    [Ecart] = [EmisReel] - [EmisPrev]
    Else
    [Ecart] = Now - [EmisPrev]
    End If
    If [Ecart] < 0 Then
    [Ecart] = 0
    End If
    End If
    If IsDate([EnvoiAppPrev]) Then
    If [Dleap] > 0 Then
    If IsDate([EnvoiAppReel]) Then
    [RetEap] = [EnvoiAppReel] - [EnvoiAppPrev]
    Else
    [RetEap] = Now - [EnvoiAppPrev]
    End If
    If [RetEap] < 0 Then
    [RetEap] = 0
    End If
    Else
    [RetEap] = 0
    End If
    End If
    End If
    End Sub


    Je suis désolé, je ne sais pas si ça peux vous aider... Si on peux voir ça en MP, pour éviter de flooder le forum..

  4. #4
    Membre habitué
    Inscrit en
    Novembre 2006
    Messages
    257
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 257
    Points : 153
    Points
    153
    Par défaut Rep.Problème erreur d'exécution 94 utilisation incorrecte null
    Essaye de modifier la ligne :

    If Dleap = 0 Then

    par

    If Nz(Dleap,0) = 0 then

    En faisant ainsi on va au plus court pour gérer ton problème, vu le niveau de connaissance que tu dis avoir.

Discussions similaires

  1. [AC-2002] erreur d'exécution '94' utilisation incorrecte de null
    Par Mpgam2 dans le forum VBA Access
    Réponses: 0
    Dernier message: 08/07/2013, 20h02
  2. Erreur d'exécution 94, Utilisation incorrecte de Null
    Par redojackson dans le forum VBA Access
    Réponses: 5
    Dernier message: 29/05/2013, 23h07
  3. [AC-2003] [VBA] Erreur d'exécution 94 - Utilisation incorrecte de Null aléatoire
    Par chahine92 dans le forum VBA Access
    Réponses: 3
    Dernier message: 19/04/2011, 22h00
  4. Réponses: 10
    Dernier message: 07/12/2010, 14h30
  5. Erreur d'exécution '94' Utilisation incorrecte du Null.
    Par zeine77 dans le forum VBA Access
    Réponses: 6
    Dernier message: 11/08/2008, 16h53

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