Ken said:
I am trying to do a comparison of one ID to another ID. They are not the
same ID so I can not use a master / child link which is what I tried
initially.
My form has a sub-form for bill of materials for Product #1 (ProdID). My
tabs have a list of other products that I would like to compare to (Product
#2 to #9) (ProdID = 2 to 9). I was hoping that as the user used the tabs the
sub-form I placed on the tab control could be used to filter my ProdID. The
first tab gets the data from Product #2 but the remaining tabs are blank.
If I followed that, you want each successive tab to exclude
whatever products were selected in the previous tabs.
This requires that you filter the previously selected
products in each subform's record source. (The Filter
property might seem like an easier way, but prior to A2007
there was a bug that made a mess of things in a multiple
subform arrangement.) To do this, you could create a
special purpose query for each subform. Each query's
product ID field's criteria would be like:
Query2
Not IN(Forms!theform.subform1.Form.ProductID)
Query3
Not
IN(Forms!theform.subform1.Form.ProductID,Forms!theform.subform2.ProductID)
Query4
Not
IN(Forms!theform.subform1.Form.ProductID,Forms!theform.subform2.ProductID,Forms!theform.subform3.ProductID)
and so on.
If all the tab pages are using the same form object as its
subform, then it would be a lot cleaner if you did the
equivalent using VBA code in the tab control's Change event.
The code would construct the SQL statement and stuff it into
the tab page's subform's RecordSource property. Post back
with more details if you need help with this.