Normal Topic [Solved] Delete Record code does not work? (Read 493 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
[Solved] Delete Record code does not work?
Aug 28th, 2007 at 9:06pm
Print Post Print Post  
Solution: Record cannot be deleted in code if the form is prevented from deleting records by using NotifyForm(4). Allow delete using NotifyForm(-4) before trying to delete record.

I have this attached to a button

var vNav as Int
If @Update
{
vNav = @SelectTreeItem("Search Update Menu!Record Commands!Delete Record (F3)")
}
If @Add
{
vNav = @SelectTreeItem("Add Data Menu!Navigation!Record Commands!Delete Record (F3)")
}

But it does not work help. please
« Last Edit: Aug 30th, 2007 at 9:20pm by Hammer »  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Delete Record code does not work?
Reply #1 - Aug 28th, 2007 at 11:59pm
Print Post Print Post  
The correct syntax is:

Add Data Menu!Record Commands!Delete Record (F3)
Search Update Menu!Record Commands!Delete Record (F3)
Change shown in bold
-----------------
var vNav as Int
If @Update
{
vNav = @SelectTreeItem("Search Update Menu!Record Commands!Delete Record (F3)")
}
If @Add
{
vNav = @SelectTreeItem("Add Data Menu!Record Commands!Delete Record (F3)")
}
---------------------------
Version 2 now has a great Menu Tree Picker so you don't have to remember.

In the Program Editor, right click in center, select List Browser.  Now click on Switch 3 times to see the  Menu Tree Items.  Select the one you want, and click on Insert

The list browser defaults to SBasic Commands, and subsequent clicks show Element Names, Font Names, and Menu Tree Items, and continues to cycle.
----------------------------------------------------------------
Other things to consider if still not working:

1.  Is programming in the OnElementEntry section for the button?

2.  Is @NotifyForm() not set to 4 ?.  Value of 4 prevents deletion.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Delete Record code does not work?
Reply #2 - Aug 30th, 2007 at 8:34pm
Print Post Print Post  
Opps thanks BOB

I had in the for a @NotifyForm(4) option.



(Newbie mistake)

Regards
P
  
Back to top
IP Logged