Delete rows in access

A

Armand

Hi everybody,
I get a little problem maybe one of us can help me,
Every day I' get a download a "Shorts Report" of every number parts,
and this file in .txt is too big for excel and I work in access but I
need delete rows with the headers, footers, & others lines in the
table, Can us explain me how made a macro for this routine.
This is a example;

Reporte de Cortos de Material _040406 B
ID Field1 Field2 Field4 Field5 Field6 Field7 Field8
1 NP DESC Qty Short Lin
set Coust Date
2 NP DESC Qty Short Lin
set Coust Date
3 NP DESC Qty Short Lin
set Coust Date
4 Total
5 Total 2
6 Empty
7 Empty
8 NP DESC Qty Short Lin
set Coust Date
9 NP DESC Qty Short Lin
set Coust Date
10 NP DESC Qty Short Lin
set Coust Date
 
V

Vincent Johns

Armand,

You'll need some easy way to distinguish the "headers, footers, &
others" lines from your data lines. For example, perhaps any line in
which [Field2] = "DESC" is a header line, and you want to ignore it. Or
maybe if [Field4] = "Qty" instead of a number, you want to ignore it.

Perhaps you have alreay imported the data into a [Reporte de Cortos]
Table. If so, you might be able to write a "Delete Query" that will
delete any record in the Table in which [Field4] = "Qty", etc. Do you
think that that will do what you need? You could use one Query to
delete header records, another Query to delete footer records, and a
third Query to delete "others" records. You could put all three Queries
into one Macro, which you could run each day after importing the text
file into your Table.

If you haven't imported the data into a Table, you might write a Module
containing VBA code that will read each record from the *.TXT file and
add only the good ones to your Table. (Someone here can help you with
that, if you wish.)

-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 

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