[AccessD] vba to Delete mult records continous form

Bob Heygood bheygood at abestsystems.com
Tue May 10 21:54:20 CDT 2005


if you choose delete record from the edit menu the records highlighted will
be deleted.
if you run the same code from vba only one will be deleted.
a vba thing.
even when using the DoMenuItem method, Access still only deletes one record.
probably something about the focus.

so, either have the users use the actual menu item.
or
use a control bound to a field to "flag" multiple records.

bob



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Doug Murphy
Sent: Tuesday, May 10, 2005 7:35 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] vba to Delete mult records continous form


I don't know about a continuous form, but in a list box there is a selected
collection that you could use to delete the selected records.  There may be
something similar in the continuous form, but I haven't played with it.  If
your not editing records the list box should provide similar functionality
to the continuous form. The other option is to put a delete field in the
continuous form and have the user check the records to delete. Then run a
delete query using the delete field as the criteria.

Not much help but some other approaches.

Doug

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath Pelletti
Sent: Tuesday, May 10, 2005 6:03 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] vba to Delete mult records continous form


RESENDING THIS AS IT DIDN'T APPEAR?

----------------------------------------------------------------------------
----

Hi everyone - maybe I am just having a bad day but can someone tell me the
code I need in vba to do the same action as the [Records]  [Delete] menu?
ie. I have a continuous form, user selects a block of records to delete.

If I use DoCmd.RunCommand acCmdDeleteRecord then it only takes out the first
rec.

How can I get rid of them all? I could do it with a delete sql string if I
knew how to reference the selected records.

TIA
Kath

______________________________________________
Kath Pelletti
Software Design & Solutions Pty Ltd.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list