From: paii, Ron on

"billy_tech" <misterhodes(a)googlemail.com> wrote in message
news:71de36c0-6ffe-4ba8-80c0-426ffe795bdb(a)t10g2000yqg.googlegroups.com...
> Hi Ron
> thanks for that code
> Unfortunately, it wouldn't quite work.
> Firstly, you're relying on mouse click to record the selection. I
> often type Ctrl+A to highlite all records in datasheet view, then
> press delete key, so the mouse events are not applicable. Also, at
> what point are you proposing running the DelSelected() function? It
> can't run at the BeforeDelConfirm stage, because by this point the
> records are permanently deleted, even if I click "No" to warning. If I
> do it in the onDelete, then it's back to original problem that I only
> want to ask user once for confirmation, even if they select multiple
> records. I'm wondering if, in the OnDelete event, I can check if the
> record is the last one in the selection. If it is, then I can delete
> all of them, otherwise cancel the deletion (but add it to the
> collection of rows to delete).
> I reckon something like
>
> Dim PurchasesToDelete as Integer 'Global var
>
> Private Sub Form_Delete(Cancel As Integer)
>
> If PurchasesToDelete = Me.SelHeight Then
> 'call function to delete records, then reset PurchasesToDelete to
> 0
> Else
> PurchasesToDelete = PurchasesToDelete + 1
> End If
>
>
> End Sub

In OnDelete set "Cancel=True" then popup a message box to confirm the delete
of the selected records, then call the delete function.


From: David W. Fenton on
billy_tech <misterhodes(a)googlemail.com> wrote in
news:08c2b5d7-9efc-4530-b189-53dcf5defcb8(a)u26g2000yqu.googlegroups.co
m:

> I am using a disconnected ADO recordset that I bind to my form in
> Access using VBA.

Why?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
From: billy_tech on
On Jul 13, 9:10 pm, "David W. Fenton" <XXXuse...(a)dfenton.com.invalid>
wrote:
> billy_tech <misterho...(a)googlemail.com> wrote innews:08c2b5d7-9efc-4530-b189-53dcf5defcb8(a)u26g2000yqu.googlegroups.co
> m:
>
> > I am using a disconnected ADO recordset that I bind to my form in
> > Access using VBA.
>
> Why?
>
> --
> David W. Fenton                  http://www.dfenton.com/
> usenet at dfenton dot com    http://www.dfenton.com/DFA/

The user doesn't have a direct link to underlying table. They only see
certain records that are filtered using business logic in a stored
procedure. A view runs too slow, I've tried that already. As such I
need a sproc. I love datasheet view though. When it's updatable, it's
by far the quickets form of data entry for our operators, so I'm
trying my hardest to replicate the functionality for them.