Message d'erreur génant ( Methodes et fonctions )

AlicePabelle Messages postés 37 Date d'inscription lundi 7 mai 2007 Statut Membre Dernière intervention 10 septembre 2007 - 19 juin 2007 à 16:08
cs_Nicko11 Messages postés 1141 Date d'inscription mercredi 7 mars 2007 Statut Membre Dernière intervention 19 septembre 2007 - 19 juin 2007 à 18:41
Bonjour

Je suis en train de realiser les requête de recherche de recherche pour mon programme.

3 types de recherches :  client, entreprise et courtier

Pour les 2 premiers, aucun soucis, ca marche, mais le 3 eme ( courtier ) ca ne marche pas.

Ca me dit : Membre de méthode ou de données introuvable


Pourtant c'est strictement la même structure que pour Cleint et entreprise.


En rouge, le passage indiqué ou cela ne marche pas :

Option Explicit

Public Function RechercherCourtier(ByVal pCode As String) As Boolean

' requetes

Dim sRequete As String
Dim rstLigneTable As ADODB.Recordset
Dim l_courtier As Courtier
Dim l_compteur As Integer

' ecran sortie
Procedures.initialiserResultats

' Affectation var
RechercherCourtier = False
Set l_courtier = New Courtier
l_courtier.initialiserTableauRechercherTitre
Range("D13").Value = " Recherche sur le code courtier : " & pCode

' Methodes

sRequete = "select * from courtier WHERE crt_code like '%" & pCode & "%'"
Set rstLigneTable = New ADODB.Recordset

' Ouverture DB
BDD.Open

' Enregistrement

Set rstLigneTable = New ADODB.Recordset
rstLigneTable.Open (sRequete), BDD

Call Procedures.presenterTitre(l_tableauRechercheTitre, 11)

' Boucle

l_compteur = 0

While Not rstLigneTable.EOF
RechercherCourtier = True

' Récup de données
Set l_courtier = New Courtier
l_compteur = l_compteur + 1

' Methode d'initialisation objet

Call l_courtier.constructorCrt(rstLigneTable("crt_code"), rstLigneTable("crt_nomdiri"), rstLigneTable("crt_prenomdiri"), rstLigneTable("crt_adresse"), rstLigneTable("crt_adresse_suite"), rstLigneTable("crt_cp"), rstLigneTable("crt_ville"), rstLigneTable("crt_telephone"), rstLigneTable("crt_portable"), rstLigneTable("crt_mail"), rstLigneTable("crt_siren"), rstLigneTable("crt_retrocession"))

' Affichage resultats

Procedures.presenterDonnees l_courtier.initialiserTableauRechercherValeur, 12, l_compteur

' Enregistrement suivant
rstLigneTable.MoveNext

Wend

' Fermeture BDD
rstLigneTable.Close
BDD.Close
End Function

Private Sub bc_rechcourt_Click()

'Recherche un courtier

Connexion.form_load
RechercherCourtier (t_rechcourt.Text)
End

End Sub


Le module ou est declaré la méthode :

 
 
'Méthode initialiserResultats()
'-> Permet d'initialiser l'écran pour l'affichage des résultats
 
Sub initialiserResultats()
Range("D13").Value = ""
 
Rows("15:100").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

Range("B16:O16").Select
Selection.Font.Bold = True
Selection.Font.ColorIndex = 0
Selection.Font.ColorIndex = 2
Selection.Interior.ColorIndex = 1
 

EndSub
 
Sub presenterTitre(ByRef tableauLibelle()AsString, ByVal p_nbEnregistement AsInteger)
 
'Déclarations variables
Dim l_indiceColonne AsInteger
Dim l_indiceLigne AsInteger
Dim l_compteurColonne AsInteger
Dim l_compteurLigne AsInteger

'INitialisation variable
l_indiceColonne = 66'Colonne B
l_indiceLigne = 16' Ligne 16
l_compteurLigne = 1

For l_compteurColonne = l_indiceColonne To(l_indiceColonne + p_nbEnregistement - 1)
Range(Chr(l_compteurColonne) & l_indiceLigne).Value = tableauLibelle(l_compteurLigne)
l_compteurLigne = l_compteurLigne + 1
Next
 
EndSub
 
Sub presenterDonnees(ByRef tableauValeurs()AsString, ByVal p_nbEnregistement AsInteger, ByVal p_numLigne AsInteger)
 
'Déclarations variables
Dim l_indiceColonne AsInteger
Dim l_indiceLigne AsInteger

'INitialisation variable
l_indiceColonne = 66'Colonne B
l_indiceLigne = 16 + p_numLigne
l_compteurLigne = 1

For l_compteurColonne = l_indiceColonne To(l_indiceColonne + p_nbEnregistement - 1)
Range(Chr(l_compteurColonne) & l_indiceLigne).Value = tableauValeurs(l_compteurLigne)
l_compteurLigne = l_compteurLigne + 1
Next
 
EndSub


et la classe de module courtier contient bien :

 
PublicSub init()
 
initialiserTableauRechercherTitre
initialiserTableauRechercherValeur
 

une idée du probleme ?

merci

2 réponses

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
19 juin 2007 à 17:55
Salut,

Et comme cela défois...

Call Procedures.presenterDonnees (l_courtier.initialiserTableauRechercherValeur, 12, l_compteur)

A+
Exploreur

 Linux a un noyau, Windows un pépin

 
0
cs_Nicko11 Messages postés 1141 Date d'inscription mercredi 7 mars 2007 Statut Membre Dernière intervention 19 septembre 2007 3
19 juin 2007 à 18:41
Salut,

en effet, c'est pas tout a faire pareil puisqu'il manque le call et les parentheses ??????
0
Rejoignez-nous