LittleSmudge
Programmer
I have an Access 2000 Front end that links to a MySQL back end via ODBC.
A certain subform has a record source that is a UNION query made up of two SELECT queries which each look at Past Through queries as their data source.
This all works fine on most users machines.
However, on 3 specific machines I get a problem.
Each SELECT component works in its own right but the UNION query will not.
( If I paste the SQL string into a query it will not change out of SQL view into datasheet view )
At run time on these three troublesome machines I just get a pop-up error message box saying
"Error Number -2147418113 Unexpected failure "
Too right it is 'Unexpected'
Any one know what's causing the problem ?
If it helps any at all the full SQL is
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
A certain subform has a record source that is a UNION query made up of two SELECT queries which each look at Past Through queries as their data source.
This all works fine on most users machines.
However, on 3 specific machines I get a problem.
Each SELECT component works in its own right but the UNION query will not.
( If I paste the SQL string into a query it will not change out of SQL view into datasheet view )
At run time on these three troublesome machines I just get a pop-up error message box saying
"Error Number -2147418113 Unexpected failure "
Too right it is 'Unexpected'
Any one know what's causing the problem ?
If it helps any at all the full SQL is
Code:
strSQL = "SELECT ItemId, InvoiceRef, ItemText, " _
& "Sum(ItemNett) AS LineItemNett, " _
& "Sum(ItemNett * VATValue) / 100 AS ItemVATValue " _
& "FROM tblVAT INNER JOIN (tbl" & gstrInvoiceType & "Item " _
& "INNER JOIN tbl" & gstrInvoiceType & "ItemBreakdown " _
& "ON tbl" & gstrInvoiceType & "Item.ItemId " _
& "= tbl" & gstrInvoiceType & "ItemBreakdown.ItemRef) " _
& "ON tblVAT.VATId = tbl" & gstrInvoiceType & "ItemBreakdown.VATRef " _
& "WHERE CodeRef <> '19999999' " _
& "GROUP BY ItemId, InvoiceRef, ItemText " _
& "HAVING InvoiceRef = " & lngFKValue & " " _
& "UNION " _
& "SELECT ItemId, InvoiceRef, ItemText,0,0 " _
& "FROM tbl" & gstrInvoiceType & "Item " _
& "LEFT JOIN tbl" & gstrInvoiceType & "ItemBreakdown " _
& "ON tbl" & gstrInvoiceType & "Item.ItemId " _
& "= tbl" & gstrInvoiceType & "ItemBreakdown.ItemRef " _
& "WHERE (CodeRef = '19999999' OR IsNull(ItemRef)) " _
& "AND ItemId Not IN (SELECT ItemId " _
& "FROM qryPTvItem " _
& "INNER JOIN qryPTvItemBreakdown " _
& "ON qryPTvItem.ItemId = qryPTvItemBreakdown.ItemRef " _
& "WHERE CodeRef <> '19999999' GROUP BY ItemId ) " _
& "AND InvoiceRef = " & lngFKValue & " " _
& "ORDER BY ItemId "
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.