Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 23rd, 2005, 10:32 AM
DanSimp DanSimp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 11 DanSimp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 45 sec
Reputation Power: 0
Lightbulb copying a linked table and contents in VB

I wish to copy the structure and the contents of a linked table (stored externally to access) into a new access table

The VB below sadly doesn't do the trick:

DoCmd.CopyObject , "NewTableName", acTable, "SourceTableName".

It only makes a mirror of the linked table. Anyone got any ideas?

Reply With Quote
  #2  
Old June 27th, 2005, 09:27 AM
theguz theguz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 54 theguz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 40 m 34 sec
Reputation Power: 4
Have you tried going to file>Get External Data>Import

This might work instead of using VBA. Good Luck

Reply With Quote
  #3  
Old June 27th, 2005, 10:57 AM
DanSimp DanSimp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 11 DanSimp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 45 sec
Reputation Power: 0
Thanks for your reply. I know that works, however that would involve user manual interaction, I wanted to automate as much as possible.

Quote:
Originally Posted by theguz
Have you tried going to file>Get External Data>Import

This might work instead of using VBA. Good Luck

Reply With Quote
  #4  
Old June 28th, 2005, 01:04 PM
theguz theguz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 54 theguz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 40 m 34 sec
Reputation Power: 4
How about after your code adding an SQL statement : SELECT * FROM [tablename] AS [NewName]

Reply With Quote
  #5  
Old June 29th, 2005, 07:12 AM
DanSimp DanSimp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 11 DanSimp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 45 sec
Reputation Power: 0
In the end I programmed it in VB, using a loop

docmd.runsql to create table b4 the loop
dcount (to get exit point for the loop)
docmd.runsql insert data in the loop

its all automated now, but would have been nice to have been able to call a simple VB function to have done the job for me, if one exists

Quote:
Originally Posted by theguz
How about after your code adding an SQL statement : SELECT * FROM [tablename] AS [NewName]

Reply With Quote
  #6  
Old June 30th, 2005, 08:36 AM
sherrington sherrington is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 85 sherrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 4 m 52 sec
Reputation Power: 5
From Access Help:

DoCmd.TransferDatabase acImport, "Microsoft Access", _
"C:\DBS\NWSales.mdb", acReport, "NW Sales for April", _
"Corporate Sales for April"

Reply With Quote
  #7  
Old July 1st, 2005, 04:01 AM
DanSimp DanSimp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 11 DanSimp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 45 sec
Reputation Power: 0
Thanks, thats the simply way I was after.

Quote:
Originally Posted by sherrington
From Access Help:

DoCmd.TransferDatabase acImport, "Microsoft Access", _
"C:\DBS\NWSales.mdb", acReport, "NW Sales for April", _
"Corporate Sales for April"

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > copying a linked table and contents


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT