473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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
1 3745
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
2
by: Ben Sharvy | last post by:
For instance, if a style-sheet is defined as ..maintext {width:35em; background-color:white;} body {background-color:gray;} And the HTML is: <div class="maintext"> some text
5
by: Johnny Meredith | last post by:
I have seven huge fixed width text file that I need to import to Access. They contain headers, subtotals, etc. that are not needed. There is also some corrupt data that we know about and can...
1
by: Andrew Chanter | last post by:
I am writing a little routine to perform the following operations from an Acces 97 mdb: 1. create a fixed width text file 2. create/establish a table type link to the text file in Access 3....
2
by: Oliver | last post by:
Hi all. Using Access 2000. Trying to import fixed width file that has column headings that I want to becom field names - it's not an option :( Is there a way to achieve this? Thanks Oliver
4
by: BostonNole | last post by:
I am looking for suggestions on the most efficient way to import 7 different fixed width files into a DataSet. Not all at the same time. One file at a time, but the format could change from file...
0
by: gelangov | last post by:
I want to export a table into a "fixed width" file using SQL 2005 import export wizard. This is the version I have: SQL Server 2005 - 9.00.2047.00 For some reason it joins all the rows...
1
by: gelangov | last post by:
I am sorry, I am posting this message again, since I did not get any reply. I want to export a table into a "fixed width" file using SQL 2005 import export wizard. This is the version I have:...
4
by: Jeff | last post by:
Hey I'm wondering how the Fixed-Width Text Format is What I know is that the top line in this text format will contain column names. and each row beneath the top line represent for example a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.