OK, the SQL of the query is:
(sorry, but this is the updated SQL where it makes a new table to get around the problem):
SELECT Account.AccountName, Program.AccountID, Program.InceptionDate, QueryPremiumClaimsCombined.ABCYearBeginLossHistory AS Year, QueryPremiumClaimsCombined.Premium, QueryPremiumClaimsCombined.Claims, [Claims]/[Premium] AS LR INTO DynamicLossHistory
FROM Account INNER JOIN (QueryPremiumClaimsCombined INNER JOIN Program ON QueryPremiumClaimsCombined.ProgramID = Program.ProgramID) ON Account.AccountID = Program.AccountID
WHERE (((Program.AccountID)=[Formulieren]![FormAskAccountLossHistory]![cboAccountNameAskLossHistory]) AND ((Program.InceptionDate)=[Formulieren]![FormAskAccountLossHistory]![cboInceptionDateLossHistory]));
And this also comes from a query called QueryPremiumClaimsCombined (as you can see), which looks like:
SELECT ProgramID, ABCYearBeginLossHistory, ABCPremium0 AS Premium, ABCClaims0 AS Claims
FROM Program
UNION ALL
SELECT ProgramID, [ABCYearBeginLossHistory]-1, [ABCPremium-1] AS Premium, [ABCClaims-1] AS Claims
FROM Program
UNION ALL
SELECT ProgramID, [ABCYearBeginLossHistory]-2, [ABCPremium-2] AS Premium, [ABCClaims-2] AS Claims
FROM Program
UNION ALL
SELECT ProgramID, [ABCYearBeginLossHistory]-3, [ABCPremium-3] AS Premium, [ABCClaims-3] AS Claims
FROM Program
UNION ALL SELECT ProgramID, [ABCYearBeginLossHistory]-4, [ABCPremium-4] AS Premium, [ABCClaims-4] AS Claims
FROM Program;
- which just transposes the variables I need into the format I need for a graph.
I am printing just using standard print buttons - either in the file menu or the print icon. I have the same problem if I ONLY print the subreport containing the graph.
Why the graph as a subreport? Because I was struggling to get the layout I wanted with a table and a graph together in a report.
Please don't kill me for such bad programming! I admit I don't know a thing about databases or SQL, but my boss asked me to do it so here I am... Thanks for your patience and help!