If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > macro to change and run query??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 23:11
firefly firefly is offline
Registered User
 
Join Date: Mar 2004
Posts: 1
Question macro to change and run query??

I've been working on importing some info into excel from a database(not access). I was wondering if someone could help me with a little snag i've run into.....

Is there any way to create a macro that will bring up an input box and info entered into the input box change the query and then run it? There are two fields throughout my query that need to be changed from day to day, and i thought a macro would be a much easier way to change the query and import the data.

Thanks in advance for your help!!
Reply With Quote
  #2 (permalink)  
Old 03-19-04, 06:42
PascalWinnen PascalWinnen is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
I don't know anything about the input box, but if you would just put the parameters in 2 cells, you have a solution.

I've found some great examples of this at :

http://www.bygsoftware.com/examples/sqlrequest.html

Goodluck !

Pascal Winnen
Reply With Quote
  #3 (permalink)  
Old 03-22-04, 15:37
Jim Lowe Jim Lowe is offline
Registered User
 
Join Date: Jan 2004
Posts: 5
Simply assign the values that change to a variable and populate that variable with values from the input box. A combo or list box would be better to ensure the field names are correct. I'm not sure if you can do multi- select boxes in Excel (you can in Access) but that would be a way to go as well.

Substitue the variables for your fields in the select statement.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On