First is an aggregate function and thus should be used in an aggregate query:
Me!L2.RowSource = "SELECT FIRST(C.NNAME) AS Player,M.SportorSports AS Sport" _
& " FROM TXMASTERS M INNER JOIN TXCLIPS C ON M.ID1=C.ID1 " _
& "WHERE M.SportorSports Like [FORMS]![NewQuerysForm]![LNAME].[CAPTION]" _
& " AND C.NNAME Like '*" & Me![T2].Text & "*'" _
& " GROUP BY M.SportorSports ORDER BY 1"
I wonder why Me![T2].Text instead of Me![T2].Value
Thanks. I must learn the syntax using C, M etc in these queries. However I have a problem as the list only fills with 1 line item, ie when I start entering an A, just one item with an A filles the list. I am trying to fill the list in a search with non repetitive lines. Hope I have not confused you. Regards
So, you don't want any aggregate at all but the DISTINCT predicate ?
Me!L2.RowSource = "SELECT DISTINCT C.NNAME AS Player, M.SportorSports AS Sport" _
& " FROM TXMASTERS M INNER JOIN TXCLIPS C ON M.ID1 = C.ID1" _
& " WHERE M.SportorSports Like [FORMS]![NewQuerysForm]![LNAME].[CAPTION]" _
& " AND C.NNAME Like '*" & Me![T2].Text & "*'" _
& " ORDER BY 1"
Many thanks PHV, that did it. Regarding the use of C, M etc, are these reserved letters, or is it a form of shortcutting table names. Would appreciate a brief reply, as your method looks much better. Have a star and thanks again
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.