B
BobRoyAce
Let's say I have a chart on a form with a Row Source that needs to include a
value returned by a function (GetLargestCategory). This function exists in a
global module and returns a single-quote delimeted string (e.g.
'Category1'). A sample Row Source is shown below. My question is "What is
the proper way to include a function call in the Row Source property?" I
have done it as shown below and I get no data back in spite of the fact
that, if I manually construct the SQL referencing the form controls, and the
function call, I get data back. An alternate solution would be if there was
a way to set the Row Source property at runtime but I don't see how to do
that. FYI, the inserted chart is a "Microsoft Graph Chart".
--- ROW SOURCE BEGINS ---
PARAMETERS [Forms]![Reporting]![Month] IEEEDouble,
[Forms]![Reporting]![Line] Text ( 255 );
TRANSFORM Sum(TimeTaken) AS SumOfTime
SELECT FiscalMonth
FROM Table1
WHERE (SystemMonth=[Forms]![Reporting]![Month])
AND (Line=[Forms]![Reporting]![Line])
AND (Category=GetLargestCategory())
GROUP BY FiscalMonth
PIVOT CategorySubType
--- ROW SOURCE ENDS ---
value returned by a function (GetLargestCategory). This function exists in a
global module and returns a single-quote delimeted string (e.g.
'Category1'). A sample Row Source is shown below. My question is "What is
the proper way to include a function call in the Row Source property?" I
have done it as shown below and I get no data back in spite of the fact
that, if I manually construct the SQL referencing the form controls, and the
function call, I get data back. An alternate solution would be if there was
a way to set the Row Source property at runtime but I don't see how to do
that. FYI, the inserted chart is a "Microsoft Graph Chart".
--- ROW SOURCE BEGINS ---
PARAMETERS [Forms]![Reporting]![Month] IEEEDouble,
[Forms]![Reporting]![Line] Text ( 255 );
TRANSFORM Sum(TimeTaken) AS SumOfTime
SELECT FiscalMonth
FROM Table1
WHERE (SystemMonth=[Forms]![Reporting]![Month])
AND (Line=[Forms]![Reporting]![Line])
AND (Category=GetLargestCategory())
GROUP BY FiscalMonth
PIVOT CategorySubType
--- ROW SOURCE ENDS ---