OVH Cloud OVH Cloud

Ouverture DoCmd.Maximize d'un formulaire

3 réponses
Avatar
Luis
Bonjour,

Dans un formulaire de commandes, j'ai un bouton pour=20
ouvrir un formulaire (la fiche livraison).
Avec:
Select Case SelectTS
=20
Case 1
DoCmd.OpenForm "FOURNIETRANGER", acNormal, , "([NCOMMANDE]
=3Dforms![COMMANDES].[R=E9fCommande] AND Forms![COMMANDES].
[SelectTS] =3D 1)"
=20
If IsNull(Forms![ FOURNIETRANGER].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut de mission pour cette=20
commande !!!"
If X =3D vbYes Then DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Case 2
DoCmd.OpenForm "FOURNI", acNormal, , "([NCOMMANDE]=3Dforms!
[COMMANDES].[R=E9fCommande] AND Forms![COMMANDES].
[SelectTS] =3D 2)"

If IsNull(Forms![FOURNI].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut d'envoi de dossier pour cette=20
commande !!!"
If X =3D vbYes Then DoCmd.Close acForm, "FOURNI"
DoCmd.Close acForm, "FOURNI"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Il y a 2 types de fiches de livraisons:
1. livraison =E0 l'=E9tranger. [FOURNIETRANGER]
2. livraison dans le pays. [FOURNI]

La fiche commande a a un champ [SelectTS] pour indiquer=20
si c'est livraison =E9tranger ou pays.
Valeur du SelectTS "1" ou "2"

Lorsqu'il n'y apas eu de livraison la MsgBox s'ouvre.
Le probl=E8me est que lorsque l'on ferme la MsgBox, le=20
formulaire Commandes ne s'ouvre plus compl=E8tement.
Il y a DoCmd.Maximize =E0 l'ouverture.
Est-t-il mal plac=E9?
Merci pour l'aide.
Luis

3 réponses

Avatar
Pierre CFI [mvp]
bonjour
tu n'as que çà comme probléme ??? :o)))

--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B

Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
"Luis" a écrit dans le message de news: 52eb01c3e4c4$2b271390$
Bonjour,

Dans un formulaire de commandes, j'ai un bouton pour
ouvrir un formulaire (la fiche livraison).
Avec:
Select Case SelectTS

Case 1
DoCmd.OpenForm "FOURNIETRANGER", acNormal, , "([NCOMMANDE]
=forms![COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 1)"

If IsNull(Forms![ FOURNIETRANGER].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut de mission pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Case 2
DoCmd.OpenForm "FOURNI", acNormal, , "([NCOMMANDE]=forms!
[COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 2)"

If IsNull(Forms![FOURNI].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut d'envoi de dossier pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNI"
DoCmd.Close acForm, "FOURNI"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Il y a 2 types de fiches de livraisons:
1. livraison à l'étranger. [FOURNIETRANGER]
2. livraison dans le pays. [FOURNI]

La fiche commande a a un champ [SelectTS] pour indiquer
si c'est livraison étranger ou pays.
Valeur du SelectTS "1" ou "2"

Lorsqu'il n'y apas eu de livraison la MsgBox s'ouvre.
Le problème est que lorsque l'on ferme la MsgBox, le
formulaire Commandes ne s'ouvre plus complètement.
Il y a DoCmd.Maximize à l'ouverture.
Est-t-il mal placé?
Merci pour l'aide.
Luis
Avatar
Luis
Bonjour,
J'ai trouvé quelque chose qui marche.

Select Case SelectTS

Case 1

If ((DCount("NCONTRAT", "LIVRAISONS", "NCOMMANDE = " &
Me.RéfCommande) = 0) And Forms![COMMANDES].[SelectTS] =
1) Then
MsgBox " Il n'y a pas eut d'envoi de dossier pour
cette commande !!!", vbExclamation + vbOKOnly

Else
DoCmd.OpenForm " FOURNIETRANGER ",
acNormal, , "[NCOMMANDE]=" & Me.RéfCommande
DoCmd.Close acForm, "COMMANDES"
End If
Exit Sub
Case 2

If ((DCount("NCONTRAT", " LIVRAISONS ", "NCOMMANDE = " &
Me.RéfCommande) = 0) And Forms![COMMANDES].[SelectTS] =
2) Then
MsgBox " Il n'y a pas eut d'envoi de dossier pour
cette commande !!!", vbExclamation + vbOKOnly

Else
DoCmd.OpenForm " FOURNI ", acNormal, , "[NCOMMANDE]=" &
Me.RéfCommande
DoCmd.Close acForm, "COMMANDES"
End If
Exit Sub


End Select

LIVRAISONS est la table.
Si vous avez des remarques je suis prenneur.
Merci.
Luis
-----Message d'origine-----
Bonjour,

Dans un formulaire de commandes, j'ai un bouton pour
ouvrir un formulaire (la fiche livraison).
Avec:
Select Case SelectTS

Case 1
DoCmd.OpenForm "FOURNIETRANGER",
acNormal, , "([NCOMMANDE]

=forms![COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 1)"

If IsNull(Forms![ FOURNIETRANGER].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut de mission pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Case 2
DoCmd.OpenForm "FOURNI", acNormal, , "([NCOMMANDE]=forms!
[COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 2)"

If IsNull(Forms![FOURNI].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut d'envoi de dossier pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNI"
DoCmd.Close acForm, "FOURNI"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Il y a 2 types de fiches de livraisons:
1. livraison à l'étranger. [FOURNIETRANGER]
2. livraison dans le pays. [FOURNI]

La fiche commande a a un champ [SelectTS] pour indiquer
si c'est livraison étranger ou pays.
Valeur du SelectTS "1" ou "2"

Lorsqu'il n'y apas eu de livraison la MsgBox s'ouvre.
Le problème est que lorsque l'on ferme la MsgBox, le
formulaire Commandes ne s'ouvre plus complètement.
Il y a DoCmd.Maximize à l'ouverture.
Est-t-il mal placé?
Merci pour l'aide.
Luis

.



Avatar
Luis
Bonjour,
apparement oui.
Pourquoi?
J'aimerai connaître le fond de ta pensée.
Merci de me répondre.
Luis
-----Message d'origine-----
bonjour
tu n'as que çà comme probléme ??? :o)))

--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B

Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
"Luis" a écrit
dans le message de news: 52eb01c3e4c4$2b271390

$
Bonjour,

Dans un formulaire de commandes, j'ai un bouton pour
ouvrir un formulaire (la fiche livraison).
Avec:
Select Case SelectTS

Case 1
DoCmd.OpenForm "FOURNIETRANGER",
acNormal, , "([NCOMMANDE]

=forms![COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 1)"

If IsNull(Forms![ FOURNIETRANGER].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut de mission pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.Close acForm, "FOURNIETRANGER"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Case 2
DoCmd.OpenForm "FOURNI", acNormal, , "([NCOMMANDE]=forms!
[COMMANDES].[RéfCommande] AND Forms![COMMANDES].
[SelectTS] = 2)"

If IsNull(Forms![FOURNI].[NCONTRAT]) Then
MsgBox "Il n'y a pas eut d'envoi de dossier pour cette
commande !!!"
If X = vbYes Then DoCmd.Close acForm, "FOURNI"
DoCmd.Close acForm, "FOURNI"
DoCmd.OpenForm "COMMANDES"

End If
Exit Sub

Il y a 2 types de fiches de livraisons:
1. livraison à l'étranger. [FOURNIETRANGER]
2. livraison dans le pays. [FOURNI]

La fiche commande a a un champ [SelectTS] pour indiquer
si c'est livraison étranger ou pays.
Valeur du SelectTS "1" ou "2"

Lorsqu'il n'y apas eu de livraison la MsgBox s'ouvre.
Le problème est que lorsque l'on ferme la MsgBox, le
formulaire Commandes ne s'ouvre plus complètement.
Il y a DoCmd.Maximize à l'ouverture.
Est-t-il mal placé?
Merci pour l'aide.
Luis


.