Query error

rishi_375

Registered User.
Local time
Today, 12:54
Joined
Dec 23, 2003
Messages
37
Hi,
I passed one parameter using form to query it shows me below error message.
" The Microsoft Jet Database engine does not recognize
[Forms]![frmUsageChart]![cboname] as a valid field name or expression"


i write query as


TRANSFORM Sum(Usage_Cost.UsageValue) AS [SumOfThe Value]
SELECT DatePart('m',[Usage_Cost].[BYM]) AS [Month]
FROM Usage_Cost where US_Code = [Forms]![frmUsageChart]![cboname]
GROUP BY DatePart('m',[Usage_Cost].[BYM])
PIVOT DatePart('yyyy',[Usage_Cost].[BYM]);

pl. anyone can help me.

Thanks.
 
Hi,
That problem solved.
Thanks.
But one more doubt is
I have one combox box, Command button and ole chart on my form.
First time my form read value form combo box and passed the query which is put above.

now i select second value from combo box and i click on Button the graph is not refreshed?

What code i have to write in Button click event?

Thnaks.
 
Hi,
Thanks for reply..
But it is not work.
It is work like this
I create query with Parameter. It is takes parameter from my this form combo box.
When i run report first time it find value in combo box. So it will display report.
Now, User is select different value and press button than again my graph shouble be change

I set graph record source name is my query name.
Thanks.
 
hi,
It is solved?
How to get month name? using query
I write my query below and i want month name insted of month number.

SELECT DatePart('m',[Usage_Cost].[BYM]) AS [Month1]
FROM Usage_Cost
WHERE [US_Code]='EL'
GROUP BY DatePart('m',[Usage_Cost].[BYM])

reply me.
 

Users who are viewing this thread

Back
Top Bottom