Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Delete SQL will not work

Status
Not open for further replies.

NewfieGolfer

Technical User
Mar 29, 2001
80
CA


I have the following code:

Private Sub

Dim key as string
Dim Lst as control

Lst = Me!list1

key = Lst.Column(0)

docmd.RunSQL "DELETE * FROM Table WHERE Field = " & key & "

End Sub


When I run it it says there are no rows to delete, but the key string contains a value and that value is in the Table. Can anyone see what's wrong here.

BTW, this is in a listbox dbl click event.


Thanks,

NG
 
Did you mean key string.
If so do

docmd.RunSQL "DELETE * FROM Table WHERE Field = '" & key & "'"

Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top