Hi All,
I'm trying to create a function to delete records from a table. I've done everything I can think of to prevent these records from being created in the first place, (short of multiple "Are you sure?" and "Have you checked xxxxx?" type message boxes, which just frustrate the users) but sometimes user error will create them.
I started out trying to use RecordSet.Delete method, but I couldn't get that to work. I think that may be related to the fact that I'm using an ODBC connection to a SQL Server back end. Can anyone shed any light on this?
I now have a DELETE query that works fine in almost all cases. The one case where it doesn't do what I want it to is where I have multiple duplicated records and I want to delete all except one. Is there a way to make a DELETE Query behave this way? Or do I need to take a snapshot of one of the records before I execute the DELETE query and then use either an APPEND query or RecordSet.AddNew?
If the latter, how would I go about adding an entire RecordSet in one hit? Is this possible?
Cheers,...Jon.
I'm trying to create a function to delete records from a table. I've done everything I can think of to prevent these records from being created in the first place, (short of multiple "Are you sure?" and "Have you checked xxxxx?" type message boxes, which just frustrate the users) but sometimes user error will create them.
I started out trying to use RecordSet.Delete method, but I couldn't get that to work. I think that may be related to the fact that I'm using an ODBC connection to a SQL Server back end. Can anyone shed any light on this?
I now have a DELETE query that works fine in almost all cases. The one case where it doesn't do what I want it to is where I have multiple duplicated records and I want to delete all except one. Is there a way to make a DELETE Query behave this way? Or do I need to take a snapshot of one of the records before I execute the DELETE query and then use either an APPEND query or RecordSet.AddNew?
If the latter, how would I go about adding an entire RecordSet in one hit? Is this possible?
Cheers,...Jon.