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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

steps to create a macro to refresh data of a sql query

Status
Not open for further replies.

sameer11

Programmer
Jun 17, 2003
89
0
0
US
Hi All,

I have never done this before nor have any clue about how I can do this

I have to create a macro to refresh the data of the Sql query I have.

I will have to create a button which says "Refresh" and then when a user click the button the data should get refreshed for a sql query.

Say for ex: Select * from schema.table1



I have figured to create a button and rename it to as "Refresh" but how do I make the sql run.

Any help is apperciated.

Thanks in Advance,
sameer
 
Create a QueryTable: menu Data -> External data -> ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I really apperciate your help..

I am a dummy what do i do next after the external data
I choose the data source(odbc) and selected the table and field and filter I needed. The excel print the columns for the query. What do I do next to create a macro?
 



If you ALREADY have a QueryTable on your sheet...

Select in the QueryTable Data

Data/Refresh.

You can macro record doing that and post back with your code.

How many QueryTables do you need to refresh?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top