Thanks Allen. Please see my answers below. After your reply I made a small
adjustment to my query, which has resulted in that MS-Access does no
longer crash but reports this error in stead: "Multi-level GROUP BY clause
is not allowed in a sub-query". Still, the query works as expected, but
when putting the field "PreviousOrders" into the report the above error
appears.
Post the main query as well.SELECT orders.orders_id, orders.suppl_onum, orders.suppl_note,
orders.date_purchased, orders.delivery_name, orders.delivery_company,
orders.delivery_street_address, orders.delivery_suburb,
orders.delivery_city, orders.delivery_postcode, orders.delivery_country,
orders.eu_vat, lang_texts.ship_to, lang_texts.items, lang_texts.item_no,
orders_products.orders_products_id,
IIf(orders!delivery_company='','',orders!delivery_company & Chr(13) &
Chr(10)) & orders!delivery_name & Chr(13) & Chr(10) &
orders!delivery_street_address & Chr(13) & Chr(10) &
IIf(orders!delivery_suburb='','',orders!delivery_suburb & Chr(13) &
Chr(10)) & orders!delivery_postcode & " " & orders!delivery_city &
Chr(13) & Chr(10) & orders!delivery_country AS Levadresse,
orders.customers_telephone, orders.customers_email_address,
products_extra.products_model, products_extra.contain_product,
[number]*[products_quantity] AS pack_quantity, products_extra.Stockcode,
orders.payment_method, lang_texts.return_address,
IIf(orders.payment_method="Talong","Giroslip",IIf(orders.payment_method
Like "*Zahlschein*","Zahlschein","")) AS Giroslip,
[pack_quantity]*[unit_weight] AS pack_weight, orders.carrier,
IIf([carrier]="RM","Royal Mail Airmail","DHL") AS form_carrier,
IIf([pack_weight]<40,0,[pack_quantity]) AS pack_bottles,
IIf([brochure]<>'',"Leaflet: " & [brochure],'') AS brochuretext,
products_extra.nomenclature, lang_texts.nomenclature_text,
lang_texts.invoice_attached, (SELECT COUNT(date_purchased) FROM orders AS
orders1 WHERE orders1.date_purchased < orders.date_purchased AND
orders1.customers_id = orders.customers_id) AS PreviousOrders
FROM orders_suppl_onum INNER JOIN (products_extra INNER JOIN ((countries
INNER JOIN (orders INNER JOIN orders_products ON orders.orders_id =
orders_products.orders_id) ON countries.countries_name =
orders.delivery_country) INNER JOIN lang_texts ON countries.lang_code =
lang_texts.language_id) ON products_extra.products_model =
orders_products.products_model) ON orders_suppl_onum.suppl_onum =
orders.suppl_onum
ORDER BY orders.orders_id, products_extra.contain_product;
And if that query is based on another query, trace that back up as well.
None
Subqueries are notorious. Presumably you've already tried a
compact/repair in case it's just a bad index.
Did so on the access database, and also the MySQL database to whom
MS-Access is linked. In fact all data for this particular query is coming
from a MySQL database. All links have been refreshed, and the MySQL
database itself has been repaired/optimized. All this has not helped.
What version of Access is this? Locate msaccess.exe on your drive
(typically in c:\Program Files\Microsoft Office\Office), right-click and
choose Properties. The Version tab gives full info. 10.0.6771.0
Also, what version of JET? Locate msjet40.dll (typically in
c:\windows\system32), and let us know the version.
4.0.8618.0