Syntax Help

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have following on the row source for my chart that is a sub form of my main
form "frmOR_POInfo_C2" I want the ITEM found on the main form to be the Item
linked to the chart to show the related data from the qryItemsConsumed. I
have the below = )=[frmOR_POInfo_C2].[ITEM] but that doesn't seem to be the
proper syntax. Can anyone help?

SELECT qryItemsConsumed.SORT1 AS PERIOD, Sum(qryItemsConsumed.SOLD) AS
SumOfSOLD FROM qryItemsConsumed WHERE (((qryItemsConsumed.ITEM)=
[frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
 
K

Ken Snell [MVP]

You need the Forms collection in the syntax:

SELECT qryItemsConsumed.SORT1 AS PERIOD, Sum(qryItemsConsumed.SOLD) AS
SumOfSOLD FROM qryItemsConsumed WHERE (((qryItemsConsumed.ITEM)=
Forms![frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
 
M

mattc66 via AccessMonster.com

How would I get the chart to requery when I go from record to record?
You need the Forms collection in the syntax:

SELECT qryItemsConsumed.SORT1 AS PERIOD, Sum(qryItemsConsumed.SOLD) AS
SumOfSOLD FROM qryItemsConsumed WHERE (((qryItemsConsumed.ITEM)=
Forms![frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
I have following on the row source for my chart that is a sub form of my
main
[quoted text clipped - 9 lines]
[frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
 
K

Ken Snell [MVP]

In the form's Current event, try requerying the chart object:

Private Sub Form_Current()
Me.NameOfChartObject.Requery
End Sub

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


mattc66 via AccessMonster.com said:
How would I get the chart to requery when I go from record to record?
You need the Forms collection in the syntax:

SELECT qryItemsConsumed.SORT1 AS PERIOD, Sum(qryItemsConsumed.SOLD) AS
SumOfSOLD FROM qryItemsConsumed WHERE (((qryItemsConsumed.ITEM)=
Forms![frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
I have following on the row source for my chart that is a sub form of my
main
[quoted text clipped - 9 lines]
[frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
 
M

mattc66 via AccessMonster.com

Thanks Ken your suggestions worked great!
In the form's Current event, try requerying the chart object:

Private Sub Form_Current()
Me.NameOfChartObject.Requery
End Sub
How would I get the chart to requery when I go from record to record?
[quoted text clipped - 10 lines]
[frmOR_POInfo_C2].[ITEM])) GROUP BY qryItemsConsumed.SORT1 ORDER BY
qryItemsConsumed.SORT1 DESC;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top