You missed:
"It would also help to know the data types of all field referenced in the
concatenate function"
I believe ORDER_NO is text since you compare it to "0000472".
Try:
SELECT V_ORDER_LINES.PART, V_ORDER_LINES.ORDER_NO,
V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ, V_ORDER_TEXT.TEXT,
Concatenate("SELECT [TEXT] & Chr(9) & Role FROM
[V_ORDER_TEXT] WHERE ORDER_NO=""" & [V_ORDER_TEXT].[ORDER_NO] &
"""",Chr(13) & Chr(10))
AS AddtLines
FROM V_ORDER_LINES LEFT JOIN V_ORDER_TEXT ON V_ORDER_LINES.ORDER_NO =
V_ORDER_TEXT.ORDER_NO
WHERE (((V_ORDER_LINES.PART)="CUSTOM15") AND
((V_ORDER_LINES.ORDER_NO)="0000472"))
ORDER BY V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ;
--
Duane Hookom
MS Access MVP
--
la knight said:
OKAY - Here's where I stand now (I have tried so many things, I think I've
gone crazy)
This is the SQL (WITHOUT) the concatenation expression:
SELECT V_ORDER_LINES.PART, V_ORDER_LINES.ORDER_NO,
V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ,
V_ORDER_TEXT.TEXT
FROM V_ORDER_LINES LEFT JOIN V_ORDER_TEXT ON V_ORDER_LINES.ORDER_NO =
V_ORDER_TEXT.ORDER_NO
WHERE (((V_ORDER_LINES.PART)="CUSTOM15") AND
((V_ORDER_LINES.ORDER_NO)="0000472"))
ORDER BY V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ;
This is the SQL (WITH) the concatenation expression:
SELECT V_ORDER_LINES.PART, V_ORDER_LINES.ORDER_NO,
V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ,
V_ORDER_TEXT.TEXT, Concatenate("SELECT [TEXT] & Chr(9) & Role FROM
[V_ORDER_TEXT] WHERE ORDER_NO=" & [V_ORDER_TEXT.ORDER_NO],Chr(13) &
Chr(10))
AS AddtLines
FROM V_ORDER_LINES LEFT JOIN V_ORDER_TEXT ON V_ORDER_LINES.ORDER_NO =
V_ORDER_TEXT.ORDER_NO
WHERE (((V_ORDER_LINES.PART)="CUSTOM15") AND
((V_ORDER_LINES.ORDER_NO)="0000472"))
ORDER BY V_ORDER_TEXT.LINE_NUMERIC, V_ORDER_LINES.DESCRIPTION,
V_ORDER_TEXT.TEXT_SEQ;
WITHOUT the Concatenation Expression I get this:
PART ORDER NO LINE NO DESCRIPTION TEXT SEQ
TEXT
15 472 1 DescriptionA 1
ABCD
15 472 1 DescriptionA 2
EFGH
15 472 2 DescriptionB 1
{this maybe blank}
15 472 2 DescriptionB 2
MY DOG
15 472 3 DescriptionB 3
SKIP
THIS IS WHAT I NEED:
PART ORDER NO DESCRIPTION TEXT
15 472 DescriptionA ABCD
EFGH
15 472 DescriptionB
MY DOG
SKIP
When I try to run the query with the Concatenation I get thi error:
Run-time error '-2147217904(80040e10)': No value given for one or more
required parameters
These are the tables: (linked ODBC - I did not create them nor can change
them)
TABLES: V_ORDER_LINES V_ORDER TEXT
FIELDS: ORDER_NO (primary) 1-M ORDER_NO
DESCRIPTION
LINE_NUMERIC
PART
TEXT_SEQ
TEXT
Any suggestions where I'm going wrong??????