easiest way to delete a block of records

M

Mo

I'm working on a solution to export greater than 65536
rows to Excel (actually 65535 rows re: the column
headings. What I'm working towards is using
TransferSpreadsheet which will transfer 65535 rows from my
temporary table. Then I want to delete the 1st 65535 rows
and repeat the transfer to another new worksheet in the
workbook. I thought I could just delete row numbers
<65536 but I haven't figured out how. My table is not
currently autonumbered but I may have to change that and
the code would be a little more complex than row numbers <
65536 as I'd have to track the rows deleted, remaining
rows, etc. Any ideas how to easily achieve this? Thanks
 
J

John Vinson

I thought I could just delete row numbers
<65536 but I haven't figured out how. My table is not
currently autonumbered but I may have to change that and
the code would be a little more complex than row numbers <
65536 as I'd have to track the rows deleted, remaining
rows, etc. Any ideas how to easily achieve this?

No easy way, since Access tables DO NOT HAVE ROW NUMBERS, period.

A Table is an unordered "bag" of data. If you have some field or
fields which you can use in an ORDER BY clause, you may be able to use
the Top Values clause of a query to select the top 65536 rows... but a
Top Values query isn't updateable, so you won't be able to turn it
into a Delete query.

Autonumbering (or appending the data into an autonumbered temp table)
may well be your best bet!
 
M

Mo

Thanks John
-----Original Message-----


No easy way, since Access tables DO NOT HAVE ROW NUMBERS, period.

A Table is an unordered "bag" of data. If you have some field or
fields which you can use in an ORDER BY clause, you may be able to use
the Top Values clause of a query to select the top 65536 rows... but a
Top Values query isn't updateable, so you won't be able to turn it
into a Delete query.

Autonumbering (or appending the data into an autonumbered temp table)
may well be your best bet!


.
 

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