Delete records/rows in subform

Wysy

Registered User.
Local time
Today, 02:59
Joined
Jul 5, 2015
Messages
335
Hi,
I want to delete a record in a subform by clicking a command button on the mainform.
I made a public function in subform
Perl:
Public function DelRec()
    docmd.runcommand accmdDeleteRecords
end function
Then onClick of the button
Code:
Public sub CMD1_Click()
    Forms!frmMain.fsub.form.DelRec
end sub

but it does not work. Any idea?
thanks
 
seems like syntax error
accmdDeleteRecord.....
sorry about that, it works now without the 's'
 
cant you just click the DELETE button on the keyboard?
 
Thank you for the detailed input. I am going to build in a message box with conformation message with default cancel button.
 
I am the only one using that DB. But i am testing your solutions. Thank you so much!
 

Users who are viewing this thread

Back
Top Bottom