How does one protect against multiple records being selected on a subform?
The subform is a datasheet, based on a temporary table built from a Union Query to allow editing of multiple record sources; works great. BUT if the user selects multiple rows to delete/ add records it breaks the application because the records are deleted first in the local temporary table. So it is unable to call the handling functions assigned to handle the deletion in the applicable table in a 3126 runtime error. So I need to disable multiple record selection somehow.
I know not to select multiple records but the user will not. I'm trying to avoid disabling record manipulation on the form because for single operations it's much faster for the user to use native Access' single record deletions... rather than having to click through a command bar; drastically slowing them down.
I also have a lot going on in the Mouse Events as I'm implementing Drag & Drop so trying not to interfere with these if possible.
Aware how to handle a multi delete (put in checkbox of selected items), which I'll put a Command Bar in there to handle it but I just need to stop the user falling into this trap.
- Current Event - if multiple records are selected it will not recognize
- Record Selectors Property - would be handy if it had a collection of the currently selected records but does not seem to have
The subform is a datasheet, based on a temporary table built from a Union Query to allow editing of multiple record sources; works great. BUT if the user selects multiple rows to delete/ add records it breaks the application because the records are deleted first in the local temporary table. So it is unable to call the handling functions assigned to handle the deletion in the applicable table in a 3126 runtime error. So I need to disable multiple record selection somehow.
I know not to select multiple records but the user will not. I'm trying to avoid disabling record manipulation on the form because for single operations it's much faster for the user to use native Access' single record deletions... rather than having to click through a command bar; drastically slowing them down.
I also have a lot going on in the Mouse Events as I'm implementing Drag & Drop so trying not to interfere with these if possible.
Aware how to handle a multi delete (put in checkbox of selected items), which I'll put a Command Bar in there to handle it but I just need to stop the user falling into this trap.
Last edited: