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 > How do I run a make table in access via excel?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-14-06, 06:21
DeadDuck DeadDuck is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
How do I run a make table in access via excel?

Hi

I am hoping someone maybe able to help with this. I currently have a make table set up in access and I am trying to run it from excel. I can pull data from the access database via excel but I cant figure out how to run the make table from excel. If indeed this is possible. Any ideas?

Cheers
DeadDuck
Reply With Quote
  #2 (permalink)  
Old 09-14-06, 16:56
Jay59 Jay59 is offline
Registered User
 
Join Date: Sep 2006
Posts: 162
You can link the tables if the data changes in ecxel and you want that to always be your data in table. Or you can import from a excel file.

File --> Get external data
Reply With Quote
  #3 (permalink)  
Old 09-15-06, 05:27
DeadDuck DeadDuck is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
cheers

Hi Jay,

thanks for the reply but I have managed to run the make table query by using the following code

Set Db = DAO.DBEngine.OpenDatabase("db Name")
Db.Execute "Qry_MakeTableName"

I have changed this now to run a delete query and then an append query to first clear the table and then write the new data to it using the following code:

Set Db = DAO.DBEngine.OpenDatabase("db Name")
Db.Execute "Delete Query Name"
Db.Execute "Append Query Name"

Unfortunately I am now having trouble passing parameters to the Append query to stop it appending all the data. For example I am trying to limit the data by Country so that it only appends all of Austria's data into the table rather than the whole worlds. I have a cell in excel which has the country name in that I want to limit by, hopefully I will be able to work this out. Unfortunately I have to use excel as the front end and hide access.

thanks for your feedback
DeadDuck
Reply With Quote
  #4 (permalink)  
Old 09-15-06, 11:22
pkstormy pkstormy is offline
Moderator
 
Join Date: Dec 2004
Location: Madison, WI
Posts: 3,925
If you use the docmd.openquery "Qry_MakeTableName" you don't need to delete the table first. The docmd.openquery automatically deletes the table if it exists while the Db.Execute command returns an error if the table exists. Also, try using the docmd.openquery instead of Db.Execute in your other commands as the docmd.openquery is more adaptable for changing parameters verses the Db.Execute. The Db.Execute is more designed for "static" and unchanging parameter queries. See if that works.
__________________
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)
Reply With Quote
  #5 (permalink)  
Old 09-16-06, 10:52
norie norie is offline
Registered User
 
Join Date: Mar 2006
Posts: 163
Why are you making a table in the first place?

Couldn't you just use a normal select query to return the required data?
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