FNC Planner Delete Item Function

Hello, I am attempting to Delete a Item in the FNC Planner, this works ok with the function to Delete Via the Delete Key on a keyboard, the entry is removed both from the form and DB.
However I am looking to Delete an Item via a Delete button on the form.
Using the following code on a button click -
TMSFNCPlanner1.Items.Delete(TMSFNCPlanner1.SelectedItems.Items[0].Index);
This deletes the entry from the Planner form, but Not the DB entry.

I am basically looking to do teh same action as the Delete key on the keyboard?

Any help - much appriciated.

Regards
David

if Assigned(TMSFNCPlanner1.Adapter) then
    TMSFNCPlanner1.Adapter.DeleteItem(TMSFNCPlanner1.SelectedItems[0])
  else
    TMSFNCPlanner1.Items.Delete(TMSFNCPlanner1.SelectedItems.Items[0].Index); 

Thanks Pawel,

This is indeed the correct code. Alternatively you can also direct remove the record from the database, and then the planner should also remove the item automatically.

Hello Pawel,

Thank you = of course the Adapter is the DB link, I was just deleating the data on the Planner.