Deleting A Record

  • Thread starter Jonathan Stratford
  • Start date
J

Jonathan Stratford

Hi,

I'm making an Access 2000 database and i want to create a button to delete a record. If i use the wizard, it refers to a button on a menu, is there not any easier way? Also, if the menu bar has been disabled, with this method still work? If not, how would I go about making it work?

Many thanks,

Jonathan Stratford
 
P

Patrick

HI Jonathan!
This code should be placed in the 'Click' event of that
button.

dim dbs as DataBase
dim strSQL as string

set dbs=CurrentDB

strSQL="Delete * FROM Clients WHERE ID=123"
dbs.Execute strSQL

This will delete any rows with a Clients ID # equal to 123.
You can format this string to do delete anything you want.
BE CAREFULL, the delete statement is very powerfull!!!
Use with moderation.....

Hope this helps..
PAtrick

-----Original Message-----
Hi,

I'm making an Access 2000 database and i want to create a
button to delete a record. If i use the wizard, it refers
to a button on a menu, is there not any easier way? Also,
if the menu bar has been disabled, with this method still
work? If not, how would I go about making it work?
 

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