[AccessD] vba to Delete mult records continous form

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Wed May 11 00:27:13 CDT 2005


Kath:

Well, SendKeys is always said to be bad form but you could use sendkeys to 
send a 'Del' in the On Click of your Delete command button.

Rocky

----- Original Message ----- 
From: "Kath Pelletti" <KP at sdsonline.net>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Tuesday, May 10, 2005 10:04 PM
Subject: Re: [AccessD] vba to Delete mult records continous form


I use icons with code attached on that form so I was hoping to modify my 
code to do a multi delete on selected records -
but it looks like I will have to add the menu bar as well so that they can 
access Edit, Delete.

It's just surprising (and annoying) to me that something we can do thru' a 
menu cannot be done easily in code.

Kath

----- Original Message ----- 
  From: Rocky Smolin - Beach Access Software
  To: Access Developers discussion and problem solving
  Sent: Wednesday, May 11, 2005 1:31 PM
  Subject: Re: [AccessD] vba to Delete mult records continous form


  Kath:

  I teach my users to hit the delete key after selecting the records to be
  deleted.  I leave the warning on so that they get that box which say" You
  are bout to delete 101,254 record.  Are you sure..."

  Is that acceptable?  Or what other approach would you like?

  Anything else, I think, would involve a different form with a multi-select
  list box.

  Unless you put a delete field in the table and display it on the form.
  Then, all the checked records could be deleted with a SQL statement like I
  posted previously - "WHERE fldDelete = TRUE"

  Rocky



  ----- Original Message ----- 
  From: "Kath Pelletti" <KP at sdsonline.net>
  To: "Access Developers discussion and problem solving"
  <accessd at databaseadvisors.com>
  Sent: Tuesday, May 10, 2005 8:08 PM
  Subject: Re: [AccessD] vba to Delete mult records continous form


  Continuous form with record selectors...users drag to select a block of
  records.
    ----- Original Message ----- 
    From: Rocky Smolin - Beach Access Software
    To: Access Developers discussion and problem solving
    Sent: Wednesday, May 11, 2005 1:03 PM
    Subject: Re: [AccessD] vba to Delete mult records continous form


    Kath:

    How are the records being selected?

    Rocky

    ----- Original Message ----- 
    From: "Kath Pelletti" <KP at sdsonline.net>
    To: "Access Developers discussion and problem solving"
    <accessd at databaseadvisors.com>
    Sent: Tuesday, May 10, 2005 7:21 PM
    Subject: Re: [AccessD] vba to Delete mult records continous form


    Yes Rocky - but when the criteria is multiple selected records (not one)
  on
    a continuous form then what does StrCriteria become??
      ----- Original Message ----- 
      From: Rocky Smolin - Beach Access Software
      To: Access Developers discussion and problem solving
      Sent: Wednesday, May 11, 2005 12:15 PM
      Subject: Re: [AccessD] vba to Delete mult records continous form


      Kath:

      dim db as DAO.Database
      Set db = Currentdb

      db.Execute "Delete * FROM tblXYZ WHERE fldSomeField = '" & strCriteria 
&
    "'"

      Without the WHERE clause it will delete all the records in the table.

      Rocky

      ----- Original Message ----- 
      From: "Kath Pelletti" <KP at sdsonline.net>
      To: <AccessD at databaseadvisors.com>
      Sent: Tuesday, May 10, 2005 6:03 PM
      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
    -- 
    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
  -- 
  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
-- 
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