Connecting Tech Pros Worldwide Help | Site Map

Deleting total content of a range in a linked table

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 04:23 PM
John Baker
Guest
 
Posts: n/a
Default Deleting total content of a range in a linked table

Hi:

I have an .xls file which I am linking into Access. This file has data on it that I am
importing to Access (copy the linked table and append it to a current access table). Once
I have done the copy, I want to erase the data in the range on he spreadsheet to avoid a
recopy (by mistake) later.

My question is simple, but I can't find a good answer. With the linked table (.xls) open
in Access what is the best and simplest way to remove ALL data from the named range and
break the link?

Regards

John Baker

  #2  
Old November 12th, 2005, 04:25 PM
Pieter Linden
Guest
 
Posts: n/a
Default Re: Deleting total content of a range in a linked table

Try this on a *BACKUP* of your file(s). (Don't want to be held
responsible for someone following or not following my goofy
instructions!) You could do the import (TransferSpreadsheet), and then
later run an update query on the linked Excel file. something like:

UPDATE xlsMyTable SET xlsMyTable.Score = Null;

which will blank out that field in the sheet.

To delete the link, you could use something like this...

CurrentDb.tabledefs("xlsMyTable").Delete

if the cells are not something that you could query for, and the range
in Excel is named, I would use Excel automation to do it... I think
you would have to disconnect the SS from Access by deleting the
tabledef first, or I *think* the OS will consider it being open and
won't allow you to delete it.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.