Everything else aside, if the query is working ok, then make it "non" hard-coded by replacing all of the years in the SQL with references to controls on a form. You can load the default values when the form loads.
psuedo:
form_load
yr=year(date), me.txbCurr=yr, me.txbCurr1=yr-1, me.txbCurr2=yr-2, etc....
then in the query, replace the years with ref's to the controls:
SELECT qrySummaryMetirics.FYear AS [Fiscal Year], Sum(IIf([FYear]=" & form1!txbCurr3 & ",[Diff1],0)) ... etc.
hth,
Steve Conklin
__._,_.___
.
__,_._,___
Tidak ada komentar:
Posting Komentar