Create Macro to import fixed width text from clipboard or text file and update table

G

ghadley_00

Hi,

I have a MS access database table for which I regularly need to import
fixed width text data. At present I have to to cut and paste the text
data from its source to a text file, save the file, import the text
file as fixed width text [it is not naturally delimited], and then run
an update query to copy the appropriate info into fields of a different
table.

Is it possible to write a macro to do all these steps? Also, is it
possible to import directly from the clipboard (to skip the step of
making a text file)?

Any help provided would be greatly appreciated.

Best wishes,

George Hadley
(e-mail address removed)
 
S

Steve Schapel

George,

As far as I know, it is not possible to import data into your database
from the clipboard.

However, the other 2 steps can certainly be done with a macro. For
importing from the text file into your Access database, you would use a
TransferText action, and then use an OpenQuery action to move it into
the main table. For the TransferText, you would run the process
"manually" first, via the File|Get External Data menu, and in the last
screen of the Import wizard, click the 'Advanced' button to save the
setup as an Import Specification. THen nominate this in the
Specification Name argument of the TransferText action.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top