Access Sorting and Deleting Certain Rows

Job ID: 39797173

Budget: $30 – $250 USD

I already have an Access (.accdb) file that pulls in a CSV flawlessly; what’s missing is a bit of post-import housekeeping.

First, every time the import completes I want the table re-sorted on four fields in this exact order:
1) date in column 1,
2) date in column 2,
3) number in column 3,
4) text in column 4.
Whether you trigger the sort with a macro, embedded VBA, or an on-import data macro is up to you—just keep it one-click (or fully automatic) for the end user.

Second, I need a routine that removes certain rows based on the value of a field and the values of the same fields in the row immediately before or after. I will explain in depth.

Please deliver an updated Access file with:
• the multi-level sort locked in
• the duplicate-removal logic callable from a button or event
• brief comments so I can tweak field names later if needed.

I prefer VBA.

The sorting part should be easy. The deleting rows is likely to be more difficult and it's not just deleting duped records.

There is a field that is a "Type" signified by "C" or "P". If a "C" is followed by another "C" then the row with the FIRST "C" has to be deleted. If a "P" is followed by another "P" then the row with the SECOND "P" has to be deleted.

Sorting has to be done first, then deleting rows.