delete with dlookup

  • Thread starter Thread starter peljo via AccessMonster.com
  • Start date Start date
P

peljo via AccessMonster.com

I have a form with not updatable controls. Can i however delete rows in the
table referring to the control clicked on the form ? For example, in my form
i have a productid = 76. Could i clicking this control delete the productid
= 76 from the table products1 ?
 
Yes, you can execute a delete query.

Dim strSQL As String
strSQL = "DELETE FROM products1 WHERE productid = " & Me.txtProductID &
";"
CurrentDb.Execute(strSQL), dbFailOnError
Me.Requery

The requery is necessary because it was in your recordset, but no longer is.
 
thank you so much ! it works !
Yes, you can execute a delete query.

Dim strSQL As String
strSQL = "DELETE FROM products1 WHERE productid = " & Me.txtProductID &
";"
CurrentDb.Execute(strSQL), dbFailOnError
Me.Requery

The requery is necessary because it was in your recordset, but no longer is.
 
Back
Top