Deleting A Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
Back
Top