Solution to tricky problem requires automation - A Suburbs Boy Living a Country Life — LiveJournal
[My Flickr Photos]
Solution to tricky problem requires automation|
|Date:||December 26th, 2007 02:18 pm (UTC)|| |
So, looking at your query, it seems you're using it to create a list of contacts to keep, thus marking the rest for deletion. So you're creating two lists of unique IDs and want to remove the ones in the full list that are not on the keep list. There's two ways to do this.
The best way is to simplify matters by reprogramming your interface and just mark the ones you want to delete: Then it's DELETE FROM table WHERE id IN (1,2,3);.
The less optimal way (because you have to pull the list twice) is to say DELETE FROM table WHERE id IN (select statement to get the full list) AND id NOT IN (your list of selected IDs);
|Date:||December 26th, 2007 05:00 pm (UTC)|| |
that in fact I'm not getting a unique ID, just an ID which I could later use to determine from which field that particular number.
So far as I can tell, the unique ID is a field called EntryID...which can't be included in a union query.
I could build up a recordset manually in VBA rather than using a union query...that might be the way to go.