Delete Query??

jaison2

New member
Local time
Today, 05:01
Joined
Dec 7, 2008
Messages
5
hi,

I am doing a project based on a cricket club. i have created a delete query to delte any players from the switchboard. I just want to know about how to link this query to the swtichboard so that when i click on the button in the switchboard it deletes it. I dont want to delte the whole table just one players record if needed. please help
 
You will probably need a parameter delete query like:
[Enter Player to Delete] in the criteria under name field or tailor to your need.

then on your button you could do some thing like this:

Private Sub Command9_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "yourquery"
End Sub
 
Howzit

Yoy can link the parameter of your query to the control on your form in the criteria section

Something like...
Code:
DELETE FROM yourtable WHERE yourfield =[Forms]![yourform]![yourcontrol];

you can then run the query using either

Code:
currentdb.execute "yourquery"

or
Code:
docmd.setwarnings false     ' turn db warnings off
docmd.openquery "yourquery"
docmd.setwarnings true   ' turn db warnings back on

If you turn the warnings off, make sure you turn them back on again.

Before trying, take a back up...
 

Users who are viewing this thread

Back
Top Bottom