bojour à tous.
mon probleme est un probleme d'affichage.
afficher le resulat d'une requete dans un formulaire à l'ouverture.sous access 2003
voici le bout de code que j'ai utilisé qui ne marche pas.
Dim sql As String
Dim rst As Recordset
On Error GoTo ErreurTraitement
sql = " SELECT LC.CodeCommande, LC.NumeroLigne,C.CodeClt, p.tx_1," & _
" LC.Code_Produit, LC.Designation, LC.Nb, LC.Depot, LC.Position, LC.Origine" & _
" FROM prospect as p, Commande as C INNER JOIN LigneCommande as LC ON" & _
" (C.CodeCommande = LC.CodeCommande) AND (C.CodeCommande = LC.CodeCommande)" & _
" WHERE LC.Position='s' AND LC.Origine='p'"
Set rst = CurrentDb.OpenRecordset(sql)
rst!CodeCommande = Me!CodeCommande
rst!NumeroLigne = Me!NumeroLigne
rst!CodeClt = Me!CodeClient
rst!tx_1 = Me!NomClient
rst!code_produit = Me!CodeProduit
rst!Designation = Me!Designation
rst!Nb = Me!Nb
rst!depot = Me!depot
me.requery
Me.RecordSource = ""
Me.RecordSource = "rst"
rst.Close
Set rst = Nothing
exit sub
end sub