Chart object not working

  • Thread starter Christopher W via AccessMonster.com
  • Start date
C

Christopher W via AccessMonster.com

I have posted this question before but I seemed to be having some difficulty,
the page kept indicating that it could not display my posting. As a result I
have reregistered, so anyone who replied please do not be offended.

I am try to produce a chart in a form developed from a query. I have a copy
of the access bible and I am following there instructions to the letter!!
However, when I insert a combo box in another form and link it as the
criteria for the query the graph spits the dummy. I receive the error;

“The Microsoft Jet engine does not recognise Forms![graph selection]!combo 9
as a valid field name or expression.

Then after pressing OK, I get another error message;

“An error occurred while sending an error to an OLE server (The application
used to create the object)”

Please help, Thanks in advance.
 
D

Duane Hookom

Check the row source of the chart control. I expect it might be a crosstab
query. If so, you must specify the data type of "combo9". Do yourself a
favor and change the name to something that makes sense then select
Query->Parameters and enter

Forms![graph selection]![cboWithDescriptiveName] Text (or
whatever)
 
C

Christopher W via AccessMonster.com

Duane, thank you very much for your reply

I have checked the Row Source as you suggested. However I not very
experienced with it and would appreciate you help with adding it in.

Row Source:

TRANSFORM Sum([New cost (Install)]) AS [SumOfNew cost (Install)] SELECT
(Format([Date of Research],"MMM 'YY")) FROM [GQ-GA-] GROUP BY (Year([Date
of Research])*12 + Month([Date of Research])-1),(Format([Date of Research],
"MMM 'YY")) PIVOT [Generic Asset ID];

The Generic Assit ID is the field that in the query requires this criteria
link [Forms]![Graph Selection]![cmbGenericID].

However it would be preferable to be able to use this criteria on Generic
Asset ID and then take the Generic asset name from that table so that when it
is graphed the asset name is displayed and not the ID as the User will not
Know that number.

Thank you, very much I am sorry I could not solve this myself


Duane said:
Check the row source of the chart control. I expect it might be a crosstab
query. If so, you must specify the data type of "combo9". Do yourself a
favor and change the name to something that makes sense then select
Query->Parameters and enter

Forms![graph selection]![cboWithDescriptiveName] Text (or
whatever)
I have posted this question before but I seemed to be having some
difficulty,
[quoted text clipped - 19 lines]
Please help, Thanks in advance.
 
D

Duane Hookom

If you only need to display information from one asset id, you might be able
to set your row source to:

SELECT (Format([Date of Research],"MMM 'YY")) ,
Sum([New cost (Install)]) AS [Sum Of New cost (Install)]
FROM [GQ-GA-]
WHERE [Generic Asset ID] = [Forms]![Graph Selection]![cmbGenericID]
GROUP BY Year([Date of Research])*12 + Month([Date of Research])-1,
Format([Date of Research], "MMM 'YY");

--
Duane Hookom
MS Access MVP


Christopher W via AccessMonster.com said:
Duane, thank you very much for your reply

I have checked the Row Source as you suggested. However I not very
experienced with it and would appreciate you help with adding it in.

Row Source:

TRANSFORM Sum([New cost (Install)]) AS [SumOfNew cost (Install)] SELECT
(Format([Date of Research],"MMM 'YY")) FROM [GQ-GA-] GROUP BY
(Year([Date
of Research])*12 + Month([Date of Research])-1),(Format([Date of
Research],
"MMM 'YY")) PIVOT [Generic Asset ID];

The Generic Assit ID is the field that in the query requires this criteria
link [Forms]![Graph Selection]![cmbGenericID].

However it would be preferable to be able to use this criteria on Generic
Asset ID and then take the Generic asset name from that table so that when
it
is graphed the asset name is displayed and not the ID as the User will not
Know that number.

Thank you, very much I am sorry I could not solve this myself


Duane said:
Check the row source of the chart control. I expect it might be a crosstab
query. If so, you must specify the data type of "combo9". Do yourself a
favor and change the name to something that makes sense then select
Query->Parameters and enter

Forms![graph selection]![cboWithDescriptiveName] Text (or
whatever)
I have posted this question before but I seemed to be having some
difficulty,
[quoted text clipped - 19 lines]
Please help, Thanks in advance.
 
C

Christopher W via AccessMonster.com

Mate
You are genies, it works a charm, I have been battling with that one for a
week. Given that it was so simple I don’t think that it something I should
admit!!!

Cheers


Duane said:
If you only need to display information from one asset id, you might be able
to set your row source to:

SELECT (Format([Date of Research],"MMM 'YY")) ,
Sum([New cost (Install)]) AS [Sum Of New cost (Install)]
FROM [GQ-GA-]
WHERE [Generic Asset ID] = [Forms]![Graph Selection]![cmbGenericID]
GROUP BY Year([Date of Research])*12 + Month([Date of Research])-1,
Format([Date of Research], "MMM 'YY");
Duane, thank you very much for your reply
[quoted text clipped - 34 lines]
 
C

Christopher W via AccessMonster.com

Actually given that you are clearly a very talented operator, I may just get
you help me with another problem I am facing. I will post this as well just
in case you don’t look back at this thread.

But I am trying to put a parameter in the SQL of a query to allow criteria
from a check box. Where the check box is selected it should only return data
from the query where the field = Yes. BUT when the check box is not selected
i.e. it is “no” the query should return all records whether the record is yes
or no. I initially though that I could do this by treating the blank check
box as though it was a Null variable. However clearly this is incorrect.

I have been trying the code like this;

AND ((([forms]![multi query]![checkbasket]= “yes”)=(select.([basket]) from
transaction where transaction.[Basket]= “yes”)) AND ((([forms]![multi query]!
[checkbasket] = “no”)=(select.([basket]) from transaction where transaction.
[Basket] = “no”or “yes”))

Any suggestions


Christopher said:
Mate
You are genies, it works a charm, I have been battling with that one for a
week. Given that it was so simple I don’t think that it something I should
admit!!!

Cheers
If you only need to display information from one asset id, you might be able
to set your row source to:
[quoted text clipped - 11 lines]
 
D

Duane Hookom

Yes/True is the same as -1 while No/False is 0. You should not get confused
and place Yes, No, True, or False inside quotes. They are not the same. You
should be able to use something like
WHERE [YesNoField] <= Forms![Multi query]![CheckBasket]

--
Duane Hookom
MS Access MVP


Christopher W via AccessMonster.com said:
Actually given that you are clearly a very talented operator, I may just
get
you help me with another problem I am facing. I will post this as well
just
in case you don’t look back at this thread.

But I am trying to put a parameter in the SQL of a query to allow criteria
from a check box. Where the check box is selected it should only return
data
from the query where the field = Yes. BUT when the check box is not
selected
i.e. it is “no” the query should return all records whether the record is
yes
or no. I initially though that I could do this by treating the blank check
box as though it was a Null variable. However clearly this is incorrect.

I have been trying the code like this;

AND ((([forms]![multi query]![checkbasket]= “yes”)=(select.([basket]) from
transaction where transaction.[Basket]= “yes”)) AND ((([forms]![multi
query]!
[checkbasket] = “no”)=(select.([basket]) from transaction where
transaction.
[Basket] = “no”or “yes”))

Any suggestions


Christopher said:
Mate
You are genies, it works a charm, I have been battling with that one for a
week. Given that it was so simple I don’t think that it something I should
admit!!!

Cheers
If you only need to display information from one asset id, you might be
able
to set your row source to:
[quoted text clipped - 11 lines]
Please help, Thanks in advance.
 
Top