form to choose to hide specific items in a list

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

Hi,

I think this must be easy to do, but I don't see how.

I have a table with items (itemID, description, ...)

A "release" (releaseID, description, ...) is a list of all the items.
Sometimes, I want to hide some of the items, so I made a table,
releaseHideItems, which holds itemID and releaseID and works great in
subsequent queries. If it's in the table, then it's hidden.

How do I make a form to populate this releaseHideItems table?
Basically, I want to display:
-item number
-description
-***check box to indicate whether an item is hidden (or not)***

I don't know how to associate the existence of a record with a check
box (or equivalent) and make it updateable.

This is what I have for the recordsource, and I'm comfortable using VBA
if necessary.
SELECT qSI.itemNo, qSI.description, HI.releaseID
FROM qrySubItems AS qSI
LEFT JOIN releaseHiddenItems AS HI ON qSI.subItemID = HI.subItemID

Thank you for any assistance.
Daniel
 
You can create a list of Items with a value showing if they belong to a
given Release using a union, something like

select Items.ItemID, Items.Name, true as Hidden
from releaseHideItems inner join Items on
releaseHideItems.ItemID=Items.ItemID
where releaseHideItems.ReleaseID=2
union
select Items.ItemID, Items.Name, false as Hidden
from Items
where Items.ItemID not in (select distinct ItemID from releaseHideItems
where ReleaseID=2)

This will return the list of Items in your item table with a "true" if it is
in the chosen release or "false" if not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top