Edit and Delete Records

G

Guest

I am having trouble editing and deleting records. Right now all the database
has a feature where I can add records. I want to edit records by having the
user search by the primary key. Once they find the primary key the rest of
the record pops up and from there they can edit the data. For the delete
feature, I want the user to find the record just like they did for the edit
feature but when the record comes up there is a button that says "Delete
Record". They would click that button to delete the record.
 
P

Perry

If you're in a form presenting the record, go:
in below sequence the code to mybutton control on yr form whereby
ID is the control pointing the ID value in table MyTable...

private mybutton_click()
Dim ssql as string
ssql = "delete from MyTable where MyID" & me.ID
currentdb.execute ssql
end sub

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 

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