Importing fields from Word or Excel to one record in access

  • Thread starter Thread starter Rickard Hansson
  • Start date Start date
R

Rickard Hansson

I know how to import a simple file to a table in access.
But if I want to make a form in word or excel where I
place every new field in a row instead of columns. Then I
want to import all fields to one record in a table in
access. Can it be done?
 
Yes, it can be done.

The best way of doing it would depend on the
structure of the Word document or Excel
worksheet.

If the Word document (say) is to contain only
one record (rather than many records), then
perhaps you could create bookmarks to cover
the ranges of text you want to capture.

Alternatively, you could set a range object
and expand it to cover the text to be captured
for a field, and repeat this for all fields.

Geoff

PS You might find the book "Writing Word
Macros" by Steven Roman helpful.
 
I do this type of conversion a lot, usually taking
someone's unwieldy WordPerfect chart and converting it
into a database. However, the only way I (self-taught
amateur) have been able to do this has been to
-save the source document as ascii.txt so that it looks
something like your data;
-import the ascii.txt data into a raw table that contains
a single row (make it 255 chars long);
-create a final table with appropriate fields; then
-write a procedure that to loop through the raw table
and, using string functions, select the appropriate data
from each raw line and insert it into the appropriate
field of a final table.

Hope this helps...
 
Back
Top