Thanks, Arvin,
This is what I tried, but an error message says "Object doesn't support this
property or method". Where have I done wrong?
Private Sub cbDeleteAmend_Click()
' qryReidAmendedProductDrawings is the query in which the record is.
' No primary key is set in this query
' FormerDWGNo (text) is the Link Master/Child field to the main form
CurrentDb.Execute "Delete * From qryReidAmendedProductDrawings Where
FormerDWGNo =" & Me.cbDeleteAmend
Me.Requery
End Sub
"Arvin Meyer" wrote:
Set the code for your command button like this:
Private Sub cmdWhatever_Click()
CurrentDb.Execute "Delete * From tblMyTable Where ID =" & Me.cboID
Me.Requery
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
"Sam Kuo" .(donotspam) wrote in message
...
Hi all,
I have created a button in a subform (with continuous form as the default
view).
I'd like to be able to click the button and delete the record. How may I
do
that?
Regards,
Sam