I understand that it implies they are numeric fields, both Supplier_ID and
Report_ID are numeric fields. I just want the data to appear such that a
record consists of a supplier_ID, a report_ID, and a concatenation of all
the
product_IDs that are supplied by the supplier_ID for each report_ID. i
have
a SupplierXREFProducts table that is a linking table, such that the 3
fields
are all foreign keys: supplier_ID goes to the Suppliers table, the
report_ID
goes to the Reports table, and the Product_ID goes to the Prodcuts table.
So
for this table each record consists of a supplier, a record, and one
product.
Now for each supplier / record combo there are many products. And that is
what i am trying to get. The point for other tables is simply to gather
the
naming for the reports and the suppliers.
I tried removing the extra quotation mark like you said and i am still
receiving the same error.
Duane Hookom said:
You have an extra "&" in your function. It is also critical to understand
the difference between text and numeric fields. The following assumes
Supplier_ID and Report_ID are both numeric fields in the table/query
SuppliersXREFProducts.
SELECT Suppliers.Supplier, Reports.Report, Concatenate("SELECT Product_ID
FROM SuppliersXREFProducts WHERE Supplier_ID =" & [Supplier_ID] & " AND
Report_ID = " & [Report_ID] ) AS ProductsSupplied
FROM Suppliers, Reports;
Do you realize you are creating a cartesian query since there are no
joins
between Suppliers and Reports?
--
Duane Hookom
MS Access MVP
I am trying to combine records into one field with each one being
separated
by a comma. I used a generic form for doing this but i cannot get it
to
work. I get a syntax error, and when i close the dialog box, the
Product_ID
is highlighted. My code is as following, can anyone help me?
SELECT Suppliers.Supplier, Reports.Report, Concatenate("SELECT
Product_ID
FROM SuppliersXREFProducts WHERE Supplier_ID =" & [Supplier_ID] & " AND
Report_ID = " & [Report_ID] & ) AS ProductsSupplied
FROM Suppliers, Reports;