Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically changing MS-Query properties within Excel.

Hi Everyone,

I have a workbook that contains an ODBC link to a database and using
MS-Query it fills a range in my workbook with some filtered data from
my source database.

My query is set up at the moment, more or less hard-coded, to get the
last 7 days of data. Because of the hard-coding, I have to go in to
the query manually and specify a new date parameter whenever the query
needs to be updated.

I'd like to be able to change the MS-Query data from Excel so that I
can change the filtering and sorting without the need to manually
modify the query every time.

Is this possible?

Regards


Greg

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Programatically changing MS-Query properties within Excel.

Greg,
Check out "parameter_query" in Excel Help.

NickHK

"Greg Glynn" wrote in message
oups.com...
Hi Everyone,

I have a workbook that contains an ODBC link to a database and using
MS-Query it fills a range in my workbook with some filtered data from
my source database.

My query is set up at the moment, more or less hard-coded, to get the
last 7 days of data. Because of the hard-coding, I have to go in to
the query manually and specify a new date parameter whenever the query
needs to be updated.

I'd like to be able to change the MS-Query data from Excel so that I
can change the filtering and sorting without the need to manually
modify the query every time.

Is this possible?

Regards


Greg



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programatically changing MS-Query properties within Excel.

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy


"Greg Glynn" wrote:

Hi Everyone,

I have a workbook that contains an ODBC link to a database and using
MS-Query it fills a range in my workbook with some filtered data from
my source database.

My query is set up at the moment, more or less hard-coded, to get the
last 7 days of data. Because of the hard-coding, I have to go in to
the query manually and specify a new date parameter whenever the query
needs to be updated.

I'd like to be able to change the MS-Query data from Excel so that I
can change the filtering and sorting without the need to manually
modify the query every time.

Is this possible?

Regards


Greg


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Programatically changing MS-Query properties within Excel.

It might be better to move away from MS Query and code in VBA with ADO.
It is quite simple and will give you much more control.
Plenty of code samples around.

RBS


"Greg Glynn" wrote in message
oups.com...
Hi Everyone,

I have a workbook that contains an ODBC link to a database and using
MS-Query it fills a range in my workbook with some filtered data from
my source database.

My query is set up at the moment, more or less hard-coded, to get the
last 7 days of data. Because of the hard-coding, I have to go in to
the query manually and specify a new date parameter whenever the query
needs to be updated.

I'd like to be able to change the MS-Query data from Excel so that I
can change the filtering and sorting without the need to manually
modify the query every time.

Is this possible?

Regards


Greg


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically changing MS-Query properties within Excel.

Thank you Gentlemen. Excellent advice. All working (and I'm
investigating ADO).

Regards

Greg



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Programatically changing MS-Query properties within Excel.


I am faced with a very similar challenge.

I have set up a parameter query and I have cells that store minimum
vendor number, maximum vendor number, minimum department number and
maximum department number.

The query works great for those particular variables.

I have not been able to figure out how to format cells for the buyer
number field where the selction criter is In('02,'05'). I keep getting
the message

"a buffer passed to a system call is too small to hold return data".

Any suggestions would be appreciated.

Sincerely

Jim Palmer


--
Jim Palmer
------------------------------------------------------------------------
Jim Palmer's Profile: http://www.excelforum.com/member.php...fo&userid=5210
View this thread: http://www.excelforum.com/showthread...hreadid=544546

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
Excel 2007 - Changing properties for Chart on Worksheet Barb Reinhardt Excel Discussion (Misc queries) 3 June 4th 09 08:24 PM
changing the properties of an excel file [email protected] Excel Programming 2 January 19th 06 10:57 AM
Programatically Changing Hover Labels David Excel Programming 2 September 20th 05 12:48 PM
How to stop Excel from changing the cell properties? Ikke Excel Discussion (Misc queries) 5 May 4th 05 10:12 PM
MS Query, command View-Query Properties Frans van Zelm Excel Discussion (Misc queries) 0 January 6th 05 02:24 PM


All times are GMT +1. The time now is 01:26 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"