BadgerLikeSpeed
Registered User.
- Local time
- Today, 15:03
- Joined
- Feb 7, 2013
- Messages
- 35
Right, back again with another issue. I've tried googling, and have not been able to make sense of the information. In terms that a complete novice would understand, can anyone help with this?
I have a table ([WatCrew]) where the dates of crew on board a boat are entered, relevant fields are [ID] (which is autonumbered), [Person], [SignOn] and [SignOff]. Each week the crew enters the names of the people on board, as well as te dates on and off. Many of the crew stay on for more than 2 weeks, but sometimes they are moved around to another vessel before their expected sign off date. What this means is that I often end up with duplicate entries in the table where the [Person] and [SignOn] dates are the same, but the [SignOff] and autonumbered [ID] field are different. The last entered record for each person is the one I'd like to keep.
Enough background, now for the question...
What I'd like to do is have some code which deletes duplicate values in my table, but leaves the latest (highest numbered) record intact. Is this possible? I need this to run in the backround, asi don't want my users to be able to access my table. Once I have the code I intend to run it when the crew entry form is closed (not sure if that is at all relevant, or if anyone has any better ideas I'm open to suggestion!).
Any and every suggestion would be much appreciated...
I have a table ([WatCrew]) where the dates of crew on board a boat are entered, relevant fields are [ID] (which is autonumbered), [Person], [SignOn] and [SignOff]. Each week the crew enters the names of the people on board, as well as te dates on and off. Many of the crew stay on for more than 2 weeks, but sometimes they are moved around to another vessel before their expected sign off date. What this means is that I often end up with duplicate entries in the table where the [Person] and [SignOn] dates are the same, but the [SignOff] and autonumbered [ID] field are different. The last entered record for each person is the one I'd like to keep.
Enough background, now for the question...
What I'd like to do is have some code which deletes duplicate values in my table, but leaves the latest (highest numbered) record intact. Is this possible? I need this to run in the backround, asi don't want my users to be able to access my table. Once I have the code I intend to run it when the crew entry form is closed (not sure if that is at all relevant, or if anyone has any better ideas I'm open to suggestion!).
Any and every suggestion would be much appreciated...