none
I would like to have a message open if a value is not this OR is not that RRS feed

  • Question

  • Hi,

    My code works on the first value, here <>"ARGENT" and I would like also to work if is not "Certificat Cadeau"

    So I wrote this code:

    If Me.[1erPaiement].Visible = True And Me.[Choisir Type de paiement] <> "ARGENT" Or Me.[Choisir Type de paiement] <> "CERTIFICAT CADEAU" Then
    DoCmd.OpenForm "Message ne peut changer carte de débit"
    Exit Sub
    End If

    However, it does not seems to look further than "ARGENT" because the message opens

    even if the field [Choisir type de paiement] shows "CERTIFICAT CADEAU", any idea what's wrong with this code?

    Thanks


    Claude Larocque
    Monday, December 5, 2011 10:13 AM

Answers

  • I think you want

    If Me.[1erPaiement].Visible = True And Me.[Choisir Type de paiement] <> "ARGENT" And Me.[Choisir Type de paiement] <> "CERTIFICAT CADEAU" Then

    The condition IMe.[Choisir Type de paiement] <> "ARGENT" Or Me.[Choisir Type de paiement] <> "CERTIFICAT CADEAU" is always True.


    Regards, Hans Vogelaar
    Monday, December 5, 2011 10:19 AM

All replies

  • I think you want

    If Me.[1erPaiement].Visible = True And Me.[Choisir Type de paiement] <> "ARGENT" And Me.[Choisir Type de paiement] <> "CERTIFICAT CADEAU" Then

    The condition IMe.[Choisir Type de paiement] <> "ARGENT" Or Me.[Choisir Type de paiement] <> "CERTIFICAT CADEAU" is always True.


    Regards, Hans Vogelaar
    Monday, December 5, 2011 10:19 AM
  • Hi Hans,

    Thanks so lot, I did the job, that was not too hard this morning, have a great day

    Claude


    Claude Larocque
    Monday, December 5, 2011 12:54 PM