Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting graph data to excel

Status
Not open for further replies.

RobinHood786

Technical User
Feb 14, 2007
12
GB
I’d like to export data from a graph to excel where the query is built in the ‘Row Source’ of the graph rather then being defined as a named query (hope this makes sense)

Ordinarily I have been using something like
DoCmd.OutputTo acQuery, "QueryName", "MicrosoftExcel(*.xls)", "", True, ""

However, because of the way I’ve built this query I don’t know how to refer to it (the name would normally go in place of “QueryName” above.

The graph is named Graph5 and is on a from called ‘RefByArea’.

To rephrase in case the question’s too disjointed

How do I refer to the data in Me.Graph5.RowSource so I can export the data using;

DoCmd.OutputTo acQuery, "QueryName", "MicrosoftExcel(*.xls)", "", True, ""

I know I could just save this as a query and just refer to it, but I got lots of graphs (100+) built this way and don’t want to convert them all.

Many thanks
Apologies if this question is badly worded but I can’t think of how to explain it more clearly.
 





Hi,

If the query is the source for the Chart, then export the query.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Hi Skip,

Many thanks for the quick response.

Certainly the row source is a query that was built using the three ... rather then being built in the query section of access and and pointing to it from row source drop-down. It therefore doesn't have a name.

That's what I'm having trouble with I don't know how to refer to this query as it's unnamed.

Regards
 




Copy the SQL

Create a new query and paste the SQL into the SQL window.

Save

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Thanks Skip,

That's what I was hoping to avoid as I have some many graphs built this way and want to give the user an option to export data for every one.

I think I was hoping to be able name the query in vba and refer to it that way,Something like

myData = Me.Graph5.Rowsource but I failed abysmally.

Ta anyway
 




Sure you can in VBA, but you posted in FORMS.

Forum705.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top