

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
5 messages in org.openoffice.fr.progRe: [prog] Prog Une erreur dans une m...| From | Sent On | Attachments |
|---|---|---|
| Jean Sympa | Jul 1, 2009 2:22 am | |
| Thibault Vataire | Jul 1, 2009 3:00 am | |
| Jean Sympa | Jul 1, 2009 8:15 am | .jpg |
| Jean Sympa | Jul 2, 2009 1:21 am | |
| Francois Gatto | Jul 2, 2009 4:06 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Prog Une erreur dans une macro | Actions... |
|---|---|---|
| From: | Jean Sympa (jsy...@free.fr) | |
| Date: | Jul 1, 2009 8:15:44 am | |
| List: | org.openoffice.fr.prog | |
| Attachments: | ||
Merci Thibault,
J'ai effectué le remplacement. A la compilation il y a une erreur
Cordialement
Papy
Thibault Vataire a écrit :
Bonjour,
Lorsque l'on associe l'exécution d'une macro à un évènement de l'application en
passant par le menu Outils > Personnaliser > Événements, l'évènement à l'origine
du déclenchement de la macro n'est pas passé en paramètre.
Il faut donc remplacer :
Sub onClickOuvrirFmTbClients( oEvent as variant ) OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbClients") end sub
par :
Sub onClickOuvrirFmTbClients() OpenForm( thisComponent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, thisComponent.ActiveConnection, "FmTbClients") end sub
Cordialement,
T. Vataire
----- Mail Original ----- De: "Jean Sympa" <jsy...@free.fr> À: "Prog" <pr...@fr.openoffice.org> Envoyé: Mercredi 1 Juillet 2009 11h23:18 GMT +02:00 Harare / Pretoria Objet: [prog] Prog Une erreur dans une macro
Bonjour à toutes et à tous,
Prog Une erreur dans une macro
Je voudrais, au démarrage d'une application, afficher un menu avec trois options. Je voudrais associer à chaque option un bouton qui me permettrait d'ouvrir un sous formulaire. Le retour d'un sous formulaire au menu ferait appel à un deuxième bouton.
Jean-Michel Pierre et François Gatto m'ont proposé un exemple. Il y a une erreur dans le formulaire, ouverture des formulaires. Je n'arrive pas à la corriger
REM ***** BASIC *****
' ouverture des formulaires
' se fait par appel d'une fonction
Sub onClickOuvrirFmTbClients( oEvent as variant )
OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbClients")
end sub
*Erreur d'exécution BASIC*
*L'argumentt n'est pas facultatif*
Sub onClickOuvrirFmTbRegion( oEvent as variant )
OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbRegion")
end sub
Sub onClickOuvrirFmTbDestinataires( oEvent as variant )
OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbDestinataires")
end sub
Sub onClickOuvrirFmTbProduits( oEvent as variant )
OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbProduits")
end sub
Sub onClickOuvrirFmTbLivraisonProduits( oEvent as variant )
OpenForm( OEvent.Source.Model.Parent.ActiveConnection.Parent.DatabaseDocument.FormDocuments, OEvent.Source.Model.Parent.ActiveConnection, "FmTbLivraisonProduits")
end sub
function OpenForm( formContainer as variant, oConnection as variant, sFormName as string) as variant
Dim aProp(1) As New com.sun.star.beans.PropertyValue
aProp(0).Name = "ActiveConnection"
aProp(0).Value = oConnection
aProp(1).Name = "OpenMode"
aProp(1).Value = "open"
OpenForm = formContainer.loadComponentFromURL(sFormName,"_blank",0,aProp())
end function
Avec mes remerciements
Cordialement
Papy








.jpg