Tech Support Guy banner

Deleting entries in Access 2010 queries

1354 Views 11 Replies 2 Participants Last post by  OBP
I want to know how to delete entries in queries without them being deleted from my tables.
Status
Not open for further replies.
1 - 12 of 12 Posts
I assume you mean "Filter" the records.
It depends on what records you do or don't want to show.
How would you make the decision.
The criteria that the entries are chosen by is "Owner ID". I need to filter out multiple entries which are listed by "Facility ID". The only way I know how to exclude them is to make an exception in the criteria listing the facility ID's that I don't want to show. Labor Intensive!
You can set the query to "Unique Values" or Unique Records" to prevent multiple records.
You can also use "Group By" when "Totals" are selected.
That doesn't work. I need to modify the query to show all the facility id's associated with the owner id except certain ones. How do I make an exception? In the owner id criteria? or in the facility id criteria?
Can you provide some example data of what you want and what you don't want.
2
These are all the facilities associated with the two owner id #'s in the query design view.
Some of the facility id #'s are what I want to be able to filter out of the query.

Attachments

See less See more
Ok, I think I get what you mean, you want to be able to include or exclude any of the Facilities you want.
The way that I would do that is to have an "Inclusion" Yes/No check box in the Facilities Table.
I would then create a form in Continuous Forms (Multiple Item) where the user can Untick any Facility that they want to exclude, or tick any they do want to include.
How about something simple, like an exception in the facility id criteria? Is that not possible?
How would you choose or set it?

You can of course "hard code" it in to the Query's Criteria, but that is very poor programming if anyone other than you has to use the database and something changes where they would need to add or delete one.
OK. I smell what you're steppin' in now. I like what you're trying to teach me. How do I set the default to "Yes"?

Attachments

See less See more
Run an Update query to update all current records, just have the "Inclusion" field and in the "Update to" row enter
-1

Then in the main query you can have the Criteria for the "Inclusion" field you would have
-1

For info a No in the check box is a 0 (zero) and an unticked box is Null.

You can also set the Field's Default value to -1 so that all new entries are set to ticked (yes).
1 - 12 of 12 Posts
Status
Not open for further replies.
Top