Deleting a record

Keith Burgess

Registered User.
Local time
Today, 11:57
Joined
Aug 10, 2006
Messages
26
Hi All,

I have a very simple name and address DB. What I would like to know is "What is the easiest way of finding a record using the switchboard and then deleting that record from the DB?"
I am an Access novice so nice easy replies would be appreciated.

Many Thanks
Keith:o
 
why with the switchboard?

the switchboard is a menu system.

-----------------
the easisest way of deleting a record is to open the table, highlight the record, and click delete

the easiest way of deleting a record in code is with this line - assuming you know the index/primary key of the record you want to delete

docmd.runsql "delete * from target_table where [targetid] = " & targetid

be careful - if you have relationships and cacading deletes defined, not only will you delete that record you will also delete every linked record.
 
gemma-the-husky said:
why with the switchboard?

the switchboard is a menu system.

-----------------
the easisest way of deleting a record is to open the table, highlight the record, and click delete

the easiest way of deleting a record in code is with this line - assuming you know the index/primary key of the record you want to delete

docmd.runsql "delete * from target_table where [targetid] = " & targetid

be careful - if you have relationships and cacading deletes defined, not only will you delete that record you will also delete every linked record.
Is it possible to open the table via the switchboard?
If so how do I do that?

Best Regards
Keith
 
Hi Gemma,

I'm not sure my reply got through last time. Can I open the table up via the switchboard. I can open the table manually but I will then have to trawl through overr 800 records to find the one I want to delete, unless you know of a quicker method???

Best Regards
Keith
 
design a query, - pull the * into the query to get all the fields there. then drag the primarykeyfield into the query grid, and in the criteria put [record to delete]

there isnt a command to open a query directly from a switchboard, although you could add an action code for it.

when you open the query it will now prompt you for the item you want, and just show you that item. now you can delete it.

if tools/options/confrm deletes is checked you will be warned before deleting the record

still beware of the cascading deletes!
 

Users who are viewing this thread

Back
Top Bottom