frustrating input data!!

A

arran1180

I'm importing data into my database from an external source, but it comes in
a very frustrating format using section headingsrather than all the info in
rows.. basically what i have looks like below

USD
date / ref / info/ number
date/ ref /info /number
AUD
date / ref / info / number

and so on.. I also ahave added a primary key (autonumber) that is assigned
to all rows upon import.

I want the above data to appear in this format

date / ref / info / number / USD
date / ref / info / number/ USD
date / ref / info / number / AUD

Is this possible with access? am at a total loss! - the only idea i have
is using the primary key to designate ranges - ie in the above example if
the key was 4 for the USD row and 7 for the AUD row there may be a way to say
where the key is between these two numbers then use USD... im pretty new to
access so any help would be greatly appreciated!
 
D

Douglas J Steele

What you can do is use VBA to read the text in line-by-line and insert the
data through SQL statements.

Use the Line Input # statement to read a line at a time, and determine
whether the line is a section heading or a detail row.

If it's a section heading, save the value. If it's a detail row, parse it
into the individual fields, add the section heading value you've saved, and
execute an INSERT INTO statement.
 

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