A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Chart problem: At a loss :-(



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2007, 10:50 AM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Chart problem: At a loss :-(

I have posted this problem in the "form" thread but have decided to post here
(apologies in advance for breaking internet forum guidelines!).

To give you an example first:

I have a form which has a single field as its data source and this data is
in a single text box.

Within the form I have a subform which contains lists of records. I have
managed to set it up so that, when I go from one record to the next in the
main form, the list in the subform is filtered.

I want to do the same with a chart (so when I go from one record to the
next, the SQL query changes).

I have the following queries:

"Avehours src"

Which create a crosstab

"AveHours src_Crosstab"

Which I use to create another select query

"AveHrs"

and I use this last query as the source for the chart.

I would like to link this last query with the text box in the form.

At the moment the only way I can filter the data in the chart is if I
specify an explicit critera (like 1,2,3,4 etc) rather than a form reference.

I am at a loss.

thanks

  #2  
Old February 15th, 2007, 01:58 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Chart problem: At a loss :-(

First thing, with a crosstab query you MUST declare your parameters and if
any
other queries are used in the crosstab their parameters must also be
declared.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2

So in your case the parameter should read something like
[Forms]![YourFormName]![YourControlName]
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"scubadiver" wrote in message
...
I have posted this problem in the "form" thread but have decided to post
here
(apologies in advance for breaking internet forum guidelines!).

To give you an example first:

I have a form which has a single field as its data source and this data is
in a single text box.

Within the form I have a subform which contains lists of records. I have
managed to set it up so that, when I go from one record to the next in the
main form, the list in the subform is filtered.

I want to do the same with a chart (so when I go from one record to the
next, the SQL query changes).

I have the following queries:

"Avehours src"

Which create a crosstab

"AveHours src_Crosstab"

Which I use to create another select query

"AveHrs"

and I use this last query as the source for the chart.

I would like to link this last query with the text box in the form.

At the moment the only way I can filter the data in the chart is if I
specify an explicit critera (like 1,2,3,4 etc) rather than a form
reference.

I am at a loss.

thanks



  #3  
Old February 15th, 2007, 03:12 PM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Chart problem: At a loss :-(


Thanks,

I didn't know about that. Although the query saves ok, when I try opening
the form, I get an "invalid bracketing" error.



"John Spencer" wrote:

First thing, with a crosstab query you MUST declare your parameters and if
any
other queries are used in the crosstab their parameters must also be
declared.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2

So in your case the parameter should read something like
[Forms]![YourFormName]![YourControlName]
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"scubadiver" wrote in message
...
I have posted this problem in the "form" thread but have decided to post
here
(apologies in advance for breaking internet forum guidelines!).

To give you an example first:

I have a form which has a single field as its data source and this data is
in a single text box.

Within the form I have a subform which contains lists of records. I have
managed to set it up so that, when I go from one record to the next in the
main form, the list in the subform is filtered.

I want to do the same with a chart (so when I go from one record to the
next, the SQL query changes).

I have the following queries:

"Avehours src"

Which create a crosstab

"AveHours src_Crosstab"

Which I use to create another select query

"AveHrs"

and I use this last query as the source for the chart.

I would like to link this last query with the text box in the form.

At the moment the only way I can filter the data in the chart is if I
specify an explicit critera (like 1,2,3,4 etc) rather than a form
reference.

I am at a loss.

thanks




  #4  
Old February 15th, 2007, 03:47 PM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Chart problem: At a loss :-(


I've got it working!!!! :-)


"John Spencer" wrote:

First thing, with a crosstab query you MUST declare your parameters and if
any
other queries are used in the crosstab their parameters must also be
declared.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2

So in your case the parameter should read something like
[Forms]![YourFormName]![YourControlName]
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"scubadiver" wrote in message
...
I have posted this problem in the "form" thread but have decided to post
here
(apologies in advance for breaking internet forum guidelines!).

To give you an example first:

I have a form which has a single field as its data source and this data is
in a single text box.

Within the form I have a subform which contains lists of records. I have
managed to set it up so that, when I go from one record to the next in the
main form, the list in the subform is filtered.

I want to do the same with a chart (so when I go from one record to the
next, the SQL query changes).

I have the following queries:

"Avehours src"

Which create a crosstab

"AveHours src_Crosstab"

Which I use to create another select query

"AveHrs"

and I use this last query as the source for the chart.

I would like to link this last query with the text box in the form.

At the moment the only way I can filter the data in the chart is if I
specify an explicit critera (like 1,2,3,4 etc) rather than a form
reference.

I am at a loss.

thanks




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.