Connecting Tech Pros Worldwide Help | Site Map

Deleting total content of a range in a linked table

  #1  
Old November 12th, 2005, 05:23 PM
John Baker
Guest
 
Posts: n/a
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, 05:25 PM
Pieter Linden
Guest
 
Posts: n/a

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.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 08:57 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 07:46 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 03:55 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 5 November 14th, 2005 12:36 PM