Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Refresh Data Import Q

I have a piece of code that uses a variable to pull info from a MS Access
database (finally through the help of this newsgroup to get it to work), all
works well, except that when I change the variable and then just 'Refresh'
the data it returns is using the previous variable that I have entered. What
I have to do is delete the old query and run a new one.

I thought it would just make sense to just 'refresh' using the new variable
as I don't want my file to balloon in size, or am I doing something wrong?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Refresh Data Import Q

Hi John,

I have a piece of code that uses a variable to pull info from a MS Access
database (finally through the help of this newsgroup to get it to work), all
works well, except that when I change the variable and then just 'Refresh'
the data it returns is using the previous variable that I have entered. What
I have to do is delete the old query and run a new one.

I thought it would just make sense to just 'refresh' using the new variable
as I don't want my file to balloon in size, or am I doing something wrong?


How have you declared the variable? The only way it will happen automatically
is if you've used a QueryTable with a parameter linked to a cell - it'll use
the value in the cell with each refresh. If you're building the query in code,
there's no link between the QueryTable and a variable. For details about
using parameters in Query tables, see :

http://www.dicks-blog.com/archives/2...l-external-dat
a-queries/

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Refresh Data Import Q

Thanks for your reply Stephen, that's a great site, the examples really help
a novice. I have only one problem when it states 'click on parameters' mine
is greyed out - I can't take the option, why is that?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Refresh Data Import Q

Hi John,

Thanks for your reply Stephen, that's a great site, the examples really help
a novice. I have only one problem when it states 'click on parameters' mine
is greyed out - I can't take the option, why is that?


That will be greyed out if you don't have any parameters in your query. If you
go through the steps Nick suggests, you'll see how it all works, then
(hopefully!) be able to adapt it to your needs.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Refresh Data Import Q

Stephen, kinda worked out how to do it, I'm assuming that the Query Wizard
won't work setting parameters. Problem is that after entering the date
parameter and after trying to put in a second parameter of product numbers
(presumably I can do that) I receive an Invalid Datetime Format Null error
appearing



"Stephen Bullen" wrote in message
...
Hi John,

Thanks for your reply Stephen, that's a great site, the examples really

help
a novice. I have only one problem when it states 'click on parameters'

mine
is greyed out - I can't take the option, why is that?


That will be greyed out if you don't have any parameters in your query. If

you
go through the steps Nick suggests, you'll see how it all works, then
(hopefully!) be able to adapt it to your needs.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Refresh Data Import Q

Stephen, forget half of my last post - got it working. One final question
which you maybe able to steer me on. I want another parameter which would
select a range of product numbers, I've tried the "IN [Enter a Range]". How
can I add an additional parameter?


"Stephen Bullen" wrote in message
...
Hi John,

Thanks for your reply Stephen, that's a great site, the examples really

help
a novice. I have only one problem when it states 'click on parameters'

mine
is greyed out - I can't take the option, why is that?


That will be greyed out if you don't have any parameters in your query. If

you
go through the steps Nick suggests, you'll see how it all works, then
(hopefully!) be able to adapt it to your needs.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Refresh Data Import Q

Hi John,

I want another parameter which would
select a range of product numbers, I've tried the "IN [Enter a Range]". How
can I add an additional parameter?


I'm not sure you can do that with linked cell parameters, I'm afraid

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


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
Import Data refresh problem PsyberFox Excel Discussion (Misc queries) 4 August 20th 08 03:07 PM
Data import from different excel files & automatic refresh Aspa Excel Discussion (Misc queries) 0 April 23rd 08 09:30 AM
Import & Refresh- Changing Formulas SMH Excel Worksheet Functions 7 March 26th 08 07:34 PM
Error on Refresh Data Import from Access 2+2=5? Excel Discussion (Misc queries) 0 February 4th 08 04:53 PM
How do i refresh external data import in excel in seconds Bala New Users to Excel 2 December 29th 05 05:12 AM


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

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

About Us

"It's about Microsoft Excel"