Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pivot Table From Access Parameter Query


I would like to built a Pivot which gets it's data from an MS Access
query which requires a parameter, which I would like to pass from
Excel.... is this possible?

if so, could someone please supply some sample code, the issue I am
having problems with is the parameter. I do not want to create the
pivot table or querytable using a SQL string from within Excel, I want
to use the Access Query.

Help or advise would be appreciated....fast [smile]

PWS


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Pivot Table From Access Parameter Query


Paul Smith wrote:
I would like to built a Pivot which gets it's data from an MS Access
query which requires a parameter, which I would like to pass from
Excel.... is this possible?

if so, could someone please supply some sample code, the issue I am
having problems with is the parameter. I do not want to create the
pivot table or querytable using a SQL string from within Excel, I

want
to use the Access Query.


Funny you should ask this, for today I posted to dicks-blog the latest
in my 'ADO in just four lines' series:

http://www.dicks-blog.com/archives/2...-data-queries/

Sub Just_Four_Lines()
Dim rs As Object
Set rs = CreateObject("ADODB.Recordset")
rs.Open _
"EXEC MyStoredProc & _
Format$(Sheet1.Range("A1).Value, "'yyyy-mm-dd'") & _
"," & _
Format$(Sheet1.Range("A2).Value, "'yyyy-mm-dd'") & _
";", _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\MyJetDB.mdb"
Sheet2.Range("A1").CopyFromRecordset rs
End Sub

You will have to handle the parameters yourself. If you use a
querytable, i.e. MS Query and its quirky SQL SELECT syntax, you could
take advantage of its in-built support for parameters. You could still
use a querytable but you would have to change the parameter values in
the procedure call yourself.

Jamie.

--

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass parameter to access query Bill Manville Links and Linking in Excel 4 May 1st 23 03:45 AM
MS query--can it handle parameter queries from Access? Dave F Excel Discussion (Misc queries) 0 September 13th 06 02:41 PM
Linking parameter query from Access to pivot table in Excel ken1975 Excel Discussion (Misc queries) 2 June 20th 06 01:51 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
Pass Parameter to Access Query Al Excel Programming 3 April 29th 04 10:15 AM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"