PDA

View Full Version : Delete multiple records



Shaimaa T
09-07-2014, 06:52 AM
Hi all,


If I want to delete multiple records (select more than a record and right-click delete) how can I achieve this


given the following with one record:
Private Sub Form_Delete(Cancel As Integer)


DoCmd.RunSQL "Delete * from Trial where TrialID =(Text40)"


Me.Refresh
End Sub

PS:- I am trying to solve the cannot update /delete because of "modifications due to multiple base tables "issue and I am not sure if attempting to add in the On delete event would fix it (instead of an instead of delete trigger since it would be useless to setup triggers with one table to update ). I am thinking of doing the same with update in the after update event.

jonh
09-07-2014, 01:39 PM
Instead of posting the same problem over and over and over again, could you tell us what you need and post an example file?

Shaimaa T
09-09-2014, 07:18 AM
Instead of starting a new thread , can I post an update thus far?

After making 2 columns (from Culture table) read only, I no longer get the insert/update issue and the delete one was managed as mentioned previously in the on delete event.

However , when I copy an entire record and paste it , I first get a duplicate issue with one of the columns(unique key constraint) and when I attempt to change the column so as not to be duplicate ...I get a #deleted for the whole record.

This does not happen when I copy the unique column from a record and paste it then change (copying that column alone).

What could be the best explanation for this and how can I attempt this issue?