By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,489 Members | 1,954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,489 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
gh********@yahoo.com

Dec 30 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
gh********@yahoo.com wrote:
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
gh********@yahoo.com


First, I would create an import spec.

Next, will the text file always have the same name? If not, how will
you know which text file to import? (If you need a FileOpen dialog, go
to http://www.mvps.org/access and check out APIs. The first API should
have the code you need to get FileOpen to work.)

You can create a macro for importing but why not create some code for it
instead. The method you should look at is TransferText in help. This
is part of Docmd. Using code is simple enough for this task, but a
macro can be used.
Dec 30 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.