Hi Ken,
The import is using Get External Data via MSQuery. I suspect you're right
about the import not evaluating the parameters prior to doing the import.
The query that requests the parameters isn't the query I'm importing. The
sequence in Access is a line of 5 queries each dependent on one another. The
parameter query is No 2 and the imported query is No 5 down the line. I've
sent the code for all 5 in Access plus the SQL from MSQuery and hope this
helps.
Many thanks.
Query 1
SELECT MSP_ASSIGNMENTS_QUERY.JobNo, MSP_ASSIGNMENTS_QUERY.VProjDesc,
MSP_ASSIGNMENTS_QUERY.Date, Sum((([Rate]/7.5)*[RemHours])) AS RemCost
FROM RTR_Rates_Query INNER JOIN MSP_ASSIGNMENTS_QUERY ON
RTR_Rates_Query.ResID = MSP_ASSIGNMENTS_QUERY.Resource
GROUP BY MSP_ASSIGNMENTS_QUERY.JobNo, MSP_ASSIGNMENTS_QUERY.VProjDesc,
MSP_ASSIGNMENTS_QUERY.Date, RTR_Rates_Query.Start, RTR_Rates_Query.End
HAVING (((MSP_ASSIGNMENTS_QUERY.VProjDesc) Is Not Null) AND
((MSP_ASSIGNMENTS_QUERY.Date) Between [RTR_Rates_Query]![Start] And
[RTR_Rates_Query]![End]+1) AND ((Sum((([Rate]/7.5)*[RemHours])))<>0))
ORDER BY MSP_ASSIGNMENTS_QUERY.Date;
Query2
SELECT MSP_RemCost_Calc1.JobNo, MSP_RemCost_Calc1.VProjDesc,
MSP_RemCost_Calc1.Date, MSP_RemCost_Calc1.RemCost AS RemCost
FROM MSP_RemCost_Calc1
WHERE (((MSP_RemCost_Calc1.Date) Between [Report FROM Date:] And [Report TO
Date:]))
ORDER BY MSP_RemCost_Calc1.JobNo;
Query 3
SELECT MSP_RemCost_Calc2.JobNo, MSP_RemCost_Calc2.VProjDesc,
Sum(MSP_RemCost_Calc2.RemCost) AS RemCost
FROM MSP_RemCost_Calc2
GROUP BY MSP_RemCost_Calc2.JobNo, MSP_RemCost_Calc2.VProjDesc
ORDER BY MSP_RemCost_Calc2.JobNo;
Query 4
SELECT MSP_Contribution_Query.JobNo, MSP_RemCost_Calc3.RemCost,
MSP_Contribution_Query.Percent_Complete, MSP_Contribution_Query.Target_Cont,
MSP_Contribution_Query.[TargCont%], MSP_Contribution_Query.TargContTD,
MSP_Contribution_Query.Cont_TD, MSP_Contribution_Query.[ContTD%]
FROM MSP_RemCost_Calc3 RIGHT JOIN MSP_Contribution_Query ON
MSP_RemCost_Calc3.JobNo = MSP_Contribution_Query.JobNo
ORDER BY MSP_Contribution_Query.JobNo;
Query 5
SELECT RTR_Project_Summary.VProjDesc, MSP_RemCost_Calc4.JobNo,
RTR_Project_Summary.ContractFee, MSP_RemCost_Calc4.RemCost,
RTR_Project_Summary.CostTD,
IIf([NRExpsTD]>[TargNRExp],[NRExpsTD],[TargNRExp]) AS NRExpsCalc,
[RemCost]+[CostTD] AS EAC, MSP_RemCost_Calc4.Percent_Complete,
MSP_RemCost_Calc4.Target_Cont, MSP_RemCost_Calc4.[TargCont%],
MSP_RemCost_Calc4.Cont_TD, MSP_RemCost_Calc4.[ContTD%],
RTR_Project_Summary.FeesEarned, RTR_Project_Summary.FeeInvoiced,
[ContractFee]-[EAC]-[NRExpsCalc] AS FwdCont£, [FwdCont£]/[ContractFee] AS
[FwdCont%], RTR_Project_Summary.PD, RTR_Project_Summary.PL,
RTR_Project_Summary.DL, RTR_Project_Summary.CL, RTR_Project_Summary.ITL,
RTR_Project_Summary.TDL
FROM MSP_RemCost_Calc4 LEFT JOIN RTR_Project_Summary ON
MSP_RemCost_Calc4.JobNo = RTR_Project_Summary.JobNo
ORDER BY MSP_RemCost_Calc4.JobNo;
Import Query
SELECT MSP_Contribution_Forecast_TimePhased.VProjDesc,
MSP_Contribution_Forecast_TimePhased.JobNo,
MSP_Contribution_Forecast_TimePhased.ContractFee,
MSP_Contribution_Forecast_TimePhased.RemCost,
MSP_Contribution_Forecast_TimePhased.CostTD,
MSP_Contribution_Forecast_TimePhased.NRExpsCalc,
MSP_Contribution_Forecast_TimePhased.EAC,
MSP_Contribution_Forecast_TimePhased.Percent_Complete,
MSP_Contribution_Forecast_TimePhased.Target_Cont,
MSP_Contribution_Forecast_TimePhased.`TargCont%`,
MSP_Contribution_Forecast_TimePhased.Cont_TD,
MSP_Contribution_Forecast_TimePhased.`ContTD%`,
MSP_Contribution_Forecast_TimePhased.FeesEarned,
MSP_Contribution_Forecast_TimePhased.FeeInvoiced,
MSP_Contribution_Forecast_TimePhased.`FwdCont£`,
MSP_Contribution_Forecast_TimePhased.`FwdCont%`,
MSP_Contribution_Forecast_TimePhased.PD,
MSP_Contribution_Forecast_TimePhased.PL,
MSP_Contribution_Forecast_TimePhased.DL,
MSP_Contribution_Forecast_TimePhased.CL,
MSP_Contribution_Forecast_TimePhased.ITL,
MSP_Contribution_Forecast_TimePhased.TDL
FROM `B:\Reports\SAM_Sync\TEST - DO NOT
DELETE`.MSP_Contribution_Forecast_TimePhased
MSP_Contribution_Forecast_TimePhased