LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Connecting Questions on Querytables

Hello all,

I have two querytables in my Excel worksheet "Sheet 1" that connect to an
Access database. Since I have two querytables, I only want to run one of the
two. So I use the following code for my command button:

Worksheets("Sheet 1").QueryTables(1).Refresh

Somehow, when I click on the button, the query would not run. In order to
run that query, I have to go into DataImport External DataEdit Query to
run. What I have been noticing is after I go into Edit Query, subsequent
clickings on the button will run the query, without going into Edit Query.
When I close the file and open it next time, I will again have problem
running the query when I click on the button, unless I go into Edit Query.

Does anyone know what causes to happen? Do I have the code correct? How
can I fix that problem? Is there a way to find out what querytable number is
for the query that I want to run?

Thanks.
 
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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
QueryTables Tomo Excel Programming 1 June 3rd 08 04:33 AM
QueryTables.Add and XML Sönke Schreiber Excel Programming 0 September 20th 06 11:43 AM
QueryTables Add Marta[_3_] Excel Programming 0 January 19th 05 05:32 PM


All times are GMT +1. The time now is 06:53 AM.

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"