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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete item from listbox query 1

Status
Not open for further replies.

davyre

Programmer
Oct 3, 2012
197
AU
Hi,
I got this delete query
Code:
DelQuery = "DELETE TblOrderUnit.* FROM TblOrderUnit WHERE OrderUnitID=TblOrderUnit.OrderunitID"
but it seems that the query is not working. What Im trying to do is to delete selected unit in the listbox, and delete the record from the table TblOrderUnit that has the same
OrderUnitID. It is so simple but I cannot figure the correct query. Anyone help? Thanks!
 
A starting point:
DelQuery = "DELETE * FROM TblOrderUnit WHERE OrderUnitID=" & Me![name of listbox].Value

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya davyre . . .

If the listbox is on an open form don't forget to requery:
Code:
[blue]Me![ListboxName].RowSource = Me![ListboxName].RowSource[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top