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 :

MsgBox en fonction de plusieurs conditions.. [AC-2003]


Sujet :

VBA Access

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Mars 2009
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 28
    Par défaut MsgBox en fonction de plusieurs conditions..
    Bonjour à tous,
    Encore une fois, j'ai besoin de vos lumières qui m'ont été si précieuses lors de mes derniers posts..
    Je vous remercie de votre aide mais il me reste un petit soucis à régler..
    Dans ma base de donnée pour des transports secondaires en hélico, je voudrais faire apparaitre des msgbox en fonction de la provenance et de la destination des patients...
    Vous trouverez mon codage vba qui ne marche pas.....lol
    J'ai un message: "erreur de compilation, bloc If sans End if", j'ai beau chercher, je ne comprends pas.
    Please help me..
    Merci

    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
    Private Sub Hospital_Destination_Country_Change()
    If Hospital_Destination_Country = "Luxembourg" Then
        If MsgBox("Does the patient come from Luxembourg", vbYesNo) = vbYes Then
        MsgBox "According the secondary mission procedure, you need only to send a demande de prise en charge to the CNS or the insurance company"
        Else
        MsgBox "According the secondary mission procedure,check if the patient is insured by CNS, or private insurance company. Then, send a demande de prise en charge to the patient insurance. "
    End If
     
    If Hospital_Destination_Country = "France" Or "Belgium" Then
        If MsgBox("Does the patient come from Luxembourg", vbYesNo) = vbYes Then
        MsgBox "According the secondary mission procedure, you need only to send a demande de prise en charge to the CNS or the insurance company"
        Else
        MsgBox "According the secondary mission procedure,this flight is from/to a foreign country, fill up a cost acceptance sheet. If this event happens during  a WE, contact DDS, ADK, HMS or RHC to approve the flight! "
    End If
     
    If Hospital_Destination_Country = "Germany" Then
        If MsgBox("Does the patient come from Luxembourg", vbYesNo) = vbYes Then
        MsgBox "According the secondary mission procedure, you need only to send a demande de prise en charge to the CNS or the insurance company"
        Else
        MsgBox "According the secondary mission procedure,LAR just needs a transportschein and a Intensivtransportprotokoll undersigned by a doctor to be paid! "
    End If
     
    End Sub

  2. #2
    Membre Expert
    Homme Profil pro
    Développeur VBA Access
    Inscrit en
    Avril 2006
    Messages
    1 109
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur VBA Access

    Informations forums :
    Inscription : Avril 2006
    Messages : 1 109
    Par défaut
    Bonsoir,
    Tu as 3 blocs de If .. End if où il manque pour chacun un End If après la dernière instruction Msgbox.

    Exemple :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    Private Sub Hospital_Destination_Country_Change()
    If Hospital_Destination_Country = "Luxembourg" Then
        If MsgBox("Does the patient come from Luxembourg", vbYesNo) = vbYes Then
        MsgBox "According the secondary mission procedure, you need only to send a demande de prise en charge to the CNS or the insurance company"
        Else
        MsgBox "According the secondary mission procedure,check if the patient is insured by CNS, or private insurance company. Then, send a demande de prise en charge to the patient insurance. "
        End If
    End If
    ou utilises un Select Case ... End select

    exemple :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    Private Sub Hospital_Destination_Country_Change()
      If MsgBox("Does the patient come from Luxembourg", vbYesNo) = vbYes Then
        MsgBox "According the secondary mission procedure, you need only to send a demande de prise en charge to the CNS or the insurance company"
      Else
       Select Case Hospital_Destination_Country
           Case "Luxembourg"
             MsgBox "According the secondary mission procedure,check if the patient is insured by CNS, or private insurance company. Then, send a demande de prise en charge to the patient insurance. "
           Case "France", "Belgium"
              MsgBox "According the secondary mission procedure,this flight is from/to a foreign country, fill up a cost acceptance sheet. If this event happens during  a WE, contact DDS, ADK, HMS or RHC to approve the flight! "
           Case "Germany"
              MsgBox "According the secondary mission procedure,LAR just needs a transportschein and a Intensivtransportprotokoll undersigned by a doctor to be paid! "
       End select     
      End if  
    End sub

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2007] fonction avec plusieurs conditions
    Par Antheadousa dans le forum Excel
    Réponses: 3
    Dernier message: 20/12/2012, 12h44
  2. [XL-2007] Recherche de données Excel en fonction de plusieurs conditions
    Par delph_le dans le forum Excel
    Réponses: 2
    Dernier message: 28/03/2012, 09h17
  3. colorier une cellule en fonction de plusieurs conditions
    Par antoine2933 dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 05/07/2011, 12h20
  4. Texte "out" en fonction de plusieurs conditions
    Par Laura48 dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 26/01/2010, 09h02
  5. Réponses: 13
    Dernier message: 24/01/2008, 09h10

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