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!

Macro to refresh data

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
 



Hi,

Is this a PivotTable or a QueryTable?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Can't we create a macro connect to a oracle db and then using the sql query to refresh the data when a refresh button is clicked ?.

I tried to create a MS query using "get external data"


Thank you,
Sameer



 



You don't need a macro to get data from an external source like Oracle.

Data/Get Exgternal Data/New Database Query - select the Oracle Driver...

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Oops. Sorry to interrupt.

Carry on. :)

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
I did try to create a query.

But how can a user click on a button and get the data refresh.

This is what i need..on a worksheet

created a button captioned as "Click to Refresh Data"

now when the user click the button. it should connect to the db and refresh the data for the following query

select * from schema.table where date >= '04-04-2004'

Can you please give me the steps to do this... apperciate all you help and time.

Thanks again,
Sameer
 



Turn on your macro recorder.

Record refresuing your QT.

What kind of button? FORM or Control Toolbox?

Easiest will be FORM.

Right click on button and select Assign Macro - NEW

Call you macro from the Button_Click

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

Part and Inventory Search

Sponsor

Back
Top