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

IHM Discussion :

bouton avec deux fonctions


Sujet :

IHM

  1. #1
    Membre régulier
    Inscrit en
    Septembre 2006
    Messages
    446
    Détails du profil
    Informations personnelles :
    Âge : 40

    Informations forums :
    Inscription : Septembre 2006
    Messages : 446
    Points : 89
    Points
    89
    Par défaut bouton avec deux fonctions
    bonjour a tous. moi j'ai un bouton dans un formulaire qui ouvre un autre formulaire. comment je fais pour lui dire que quand il rentre dans le formulaire il doit fermer la fenetre precedente?

    moi j'ai fais ce code mais il me dit que l'objet que je cherche il est fermè

    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
    24
    25
    26
    27
    28
    29
    30
    Private Sub Comando71_Click()
    On Error GoTo Err_Comando71_Click
     
     
       DoCmd.Close
     
       Dim stDocName As String
     
     
        Dim StLinkCriteria As String
     
        stDocName = "uscite_comande_ss"
     
        Form_Menu_SS.IDContatto = Me.Lista_clienti.Value
        DoCmd.OpenForm stDocName, , , StLinkCriteria
        Forms!uscite_comande_ss!Nome = Form_Selezione_cliente.Lista_clienti.Column(1)
        Forms!uscite_comande_ss!Cognome = Form_Selezione_cliente.Lista_clienti.Column(2)
        Forms!uscite_comande_ss!IDContatto = Form_Selezione_cliente.Lista_clienti.Column(0)
     
     
     
    Exit_Comando71_Click:
        Exit Sub
     
    Err_Comando71_Click:
        MsgBox Err.Description
        Resume Exit_Comando71_Click
     
     
    End Sub

  2. #2
    ARO
    ARO est déconnecté
    Membre habitué

    Profil pro
    Inscrit en
    Novembre 2002
    Messages
    74
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2002
    Messages : 74
    Points : 128
    Points
    128
    Par défaut
    Ton Docmd.close est mal positionné. Tu fermes ton formulaire et tu fais appel à lui dans le code.

    Place le à la fin de ton code.

    Alain

  3. #3
    Membre régulier
    Inscrit en
    Septembre 2006
    Messages
    446
    Détails du profil
    Informations personnelles :
    Âge : 40

    Informations forums :
    Inscription : Septembre 2006
    Messages : 446
    Points : 89
    Points
    89
    Par défaut
    Citation Envoyé par ARO Voir le message
    Ton Docmd.close est mal positionné. Tu fermes ton formulaire et tu fais appel à lui dans le code.

    Place le à la fin de ton code.

    Alain
    j'arrive pas a placer le Docmd.close, j'ai esseie plusier partie mais je n'arrive pas a faire ce que je veux. où je dois le placer?

  4. #4
    ARO
    ARO est déconnecté
    Membre habitué

    Profil pro
    Inscrit en
    Novembre 2002
    Messages
    74
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2002
    Messages : 74
    Points : 128
    Points
    128
    Par défaut
    Bonjour,

    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
    24
    25
    26
    27
    28
    29
     
     
    Private Sub Comando71_Click()
    On Error GoTo Err_Comando71_Click
     
     
       Dim stDocName As String
     
     
        Dim StLinkCriteria As String
     
        stDocName = "uscite_comande_ss"
     
        Form_Menu_SS.IDContatto = Me.Lista_clienti.Value
        DoCmd.OpenForm stDocName, , , StLinkCriteria
        Forms!uscite_comande_ss!Nome = Me.Lista_clienti.Column(1)
        Forms!uscite_comande_ss!Cognome =Me.Lista_clienti.Column(2)
        Forms!uscite_comande_ss!IDContatto = Me.Lista_clienti.Column(0)
     
        DoCmd.Close acForm, Me.Name
     
    Exit_Comando71_Click:
        Exit Sub
     
    Err_Comando71_Click:
        MsgBox Err.Description
        Resume Exit_Comando71_Click
     
    End Sub
    Tu déclares StLinkCriteria mais tu donnes aucune valeur ?


    Alain

  5. #5
    Membre régulier
    Inscrit en
    Septembre 2006
    Messages
    446
    Détails du profil
    Informations personnelles :
    Âge : 40

    Informations forums :
    Inscription : Septembre 2006
    Messages : 446
    Points : 89
    Points
    89
    Par défaut
    merci marche tres bien.....


    Citation Envoyé par ARO Voir le message
    Bonjour,

    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
    24
    25
    26
    27
    28
    29
     
     
    Private Sub Comando71_Click()
    On Error GoTo Err_Comando71_Click
     
     
       Dim stDocName As String
     
     
        Dim StLinkCriteria As String
     
        stDocName = "uscite_comande_ss"
     
        Form_Menu_SS.IDContatto = Me.Lista_clienti.Value
        DoCmd.OpenForm stDocName, , , StLinkCriteria
        Forms!uscite_comande_ss!Nome = Me.Lista_clienti.Column(1)
        Forms!uscite_comande_ss!Cognome =Me.Lista_clienti.Column(2)
        Forms!uscite_comande_ss!IDContatto = Me.Lista_clienti.Column(0)
     
        DoCmd.Close acForm, Me.Name
     
    Exit_Comando71_Click:
        Exit Sub
     
    Err_Comando71_Click:
        MsgBox Err.Description
        Resume Exit_Comando71_Click
     
    End Sub
    Tu déclares StLinkCriteria mais tu donnes aucune valeur ?


    Alain

  6. #6
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    126
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 126
    Points : 179
    Points
    179
    Par défaut
    tu déclares sTLinkCriteria mais tu ne lui affecte rien ?
    Dim StLinkCriteria As String
    Petite précision, c'est le wizard d'access 2007 qui crèe cette variable lorsqu'on lui demande de nous faire un bouton qui ouvre un formulaire.

    Tu peux supprimer la ligne, elle ne sert à rien ici :p

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

Discussions similaires

  1. bouton avec double fonction
    Par maria84 dans le forum Langage
    Réponses: 3
    Dernier message: 04/10/2011, 16h20
  2. setInterval avec deux fonctions
    Par djouk dans le forum Général JavaScript
    Réponses: 6
    Dernier message: 06/01/2011, 18h26
  3. Probléme requête avec deux fonction SUM
    Par kamnouz dans le forum Requêtes
    Réponses: 2
    Dernier message: 08/04/2010, 16h29
  4. Creation d'un bouton avec plusieurs fonctions
    Par remslol dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 13/05/2008, 22h31
  5. Image avec deux fonctions OnIDblClick
    Par Romainll93 dans le forum Delphi
    Réponses: 3
    Dernier message: 25/02/2007, 14h17

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