delete query with custom form

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
 
J

Joel Allen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top