Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete access query results

Status
Not open for further replies.

flycold

Programmer
Jan 17, 2004
15
GB
hi

i have one table on microsoft access database. i am running a query on that table which produces the required results.

what i need to do is then (upon pressing a command button) delete the results from the main table

any help would be appriciated

spider
 
Hi,
Go to the design view of the Query and change it to "Delete Query"
Query > DeleteQuery

You have to put criteria for the field. You can use the same command button. Up on clicking it you will get po up message to confirm the action.

Hope this help


Zameer Abdulla

 
i have tried the delete query already. it deletes the whole of the query which i would like to use again in the future.

all i want is to delete the records brought up by the query.

flycold
 
You don't delete the query. You turn it into delete query. It's one of the options in the Query (QBE) screen.

 
either way it will only delete the records pulled up by the query. i want it to delete the records that are pulled up in the main table.

flycold

 
The way Access works is if you delete records in a query then you've deleted the records in the source table(s).

Whatever your query is, look at the SQL. If it does not contain the word DELETE then you haven't got a delete query.

 
o.k

i have created a delete query which has the criteria >01/01/2001 under the date field

i have then created a command button on the form and created a macro to go with this,

what do i need under the action? i previously had delete object hence it was deleting my whole query

thanks

flycold
 
Just looking at the drop-down of actions it looks like OpenQuery

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top