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

delete ith DLookup 1

Status
Not open for further replies.

peljo

Technical User
Mar 3, 2006
91
0
0
BG
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 ?
 
You can set AllowDeletes without AllowEdits or you can run a query through vba. I guess you are refering to a continuous form and a control at the end of each line? If so:

Code:
strSQL="Delete From tblTable Where NumericID=" & Me.txtNumericID
CurrentDB.Execute strSQL, dbFailOnError

 
You could put a button on the form, and OnClick run the code Remou has above. Then I'd REQUERY or else it shows up #DELETED in each field.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Thank you so much ! It works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top