delete query with custom form

  • Thread starter Thread starter Joel Allen
  • Start date Start date
J

Joel Allen

Hi,

I run a Select query within by form that works fine.

Set rst= CreateObject("ADODB.Recordset")

rst.Open "Select PartID FROM tblNonStockParts WHERE PartID = '" &
Trim(Item.UserProperties("PartID").value) & "'", _

oADOConn, adOpenKeyset, adCmdTable


I changed it to a Delete query and it tells me that the PartID could not be
found. Any ideas?


Set rst= CreateObject("ADODB.Recordset")

rst.Open "Delete PartID FROM tblNonStockParts WHERE PartID = '" &
Trim(Item.UserProperties("PartID").value) & "'", _

oADOConn, adOpenKeyset, adCmdTable



Thanks,

Joel
 
I found a solution. Here it is if anybody cares. I just had the syntax
wrong:

Set rst= CreateObject("ADODB.Recordset")

Rst.Open "Delete FROM tblNonStockParts WHERE PartID = " &
Trim(Item.UserProperties("PartID").value) , _

oADOConn, adOpenKeyset, adCmdTable
 
Back
Top