Normal Topic Delete records with a Button (Read 559 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Delete records with a Button
Nov 9th, 2005 at 1:17pm
Print Post Print Post  
Dear Lantica and its users!

I am interested to use a Button in a table Subform to delete the selected group of records (order parameters). So i can delete all  the parameters and add the correct new records, without to scroll through the record set  manualy and F3 but iŽd like to automate this process.
is one loop arrangement and selecttreeitem the solution?


« Last Edit: Nov 9th, 2005 at 4:59pm by Amor »  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Delete records with a Button
Reply #1 - Nov 9th, 2005 at 8:46pm
Print Post Print Post  
If you do not want the F3 confirmation, you will need to record a macro that hits F3 on the subform, save that macro, and call it in a loop for each sub-record.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Delete records with a Button
Reply #2 - Nov 9th, 2005 at 8:55pm
Print Post Print Post  
A macro will do it, as Mark just pointed out, but a Macro that deletes records is dangerous. For instance, If for some reason the subform can not take focus, the macro will not stop, it will hit F3 and probably the parent record will be deleted.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Delete records with a Button
Reply #3 - Nov 9th, 2005 at 9:09pm
Print Post Print Post  
My macro includes the click into the subform. Even if there are no records, there is always the one blank row that takes focus. That should make it somewhat safer than a "blind" F3. Though, Ray is right, macros are dangerous, and macros that press F3, especially so.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged