Hi all, I have a query. It works fine. But when I call it from the VBA code, I get a type mismatch error. I've been pausing the code, manually running the query, then continuing the code from the next line, so I know the point in time when the docmd.openquery was called, every variable possible is identical when I open it manually. Has anyone ever encountered this?
I don't know if this helps at all without knowing data types and background info, but here's the query SQL:
Code:
INSERT INTO LineItemComponentsT ( ComponentID, ID, ComponentDescription, SourceComponent )
SELECT LineItemsQ.ID, InsertAutoTotalComponentsA.ID, "AutoTotal" AS Source, InsertAutoTotalComponentsA.id AS src
FROM LineItemsQ, InsertAutoTotalComponentsA
WHERE (((LineItemsQ.Heading)=[forms]![LineItemSummaryCF]![DisplayHeading]) AND ((LineItemsQ.Report)=[forms]![LineItemSummaryCF]![Report]));