Please help me!
What I have:
First, I'm using Access 2007. I have a form that include's a subform. In that subform a have a datasheet from a SQL query which get 3 fields. The first field (Supprimer) his a dummy field to display a hyperlink that will be use has a button:
SELECT "Supprimer", permis.abbreviation, permis.description
FROM permis
INNER JOIN (clients INNER JOIN clients_permis
ON clients.ID=clients_permis.id_clients)
ON permis.ID=clients_permis.id_permis;
What I want I want my "delete" hyperlinks to delete the datasheet selected record has would pressing the "del" key would
My code for onClick event
Private Sub del_Click()
DoCmd.RunCommand acCmdSelectRecord
'SendKeys ("{DELETE}")
DoCmd.RunCommand acCmdDeleteRecord
End Sub
If I uncommented, the Sendkeys ("{DELETE}") the record is deleted, but, on my systeme this also triggers the numlock key. Who knows what it can do on other system.
the DoCmd.RunCommand acCmdDeleteRecord command provokes a Run-Time Error: 2046.
At a previous point the above code worked perfectly.