"If I understand your proposal correctly, I would
manually (?) assign values in a table that I would create
and then recreate the table and update it for each for
each level / as I rerun the query (a series of Make
Tables?)."
Nope. If you are not allowed to mess with the original table, start
with a maketable query that copies all of the data over, as well as the
additional BOMLEVEL field. You can do this by entering into a new field
(after selecting all of the other
BOMLEVEL:1
Which will create a field called BOMLEVEL in teh new table and prefill
the fields with a ONE.
Then build each query to raise the BOMLEVEL. Finally, throw all of
those into a macro, (make sure you get it all in the right order), so
that it is a one step proccess. This allows you to rerun it at any
time.
" I have played with IIF statements, other formulas and criteria,"
Don't need it. I am relying on self deselection. It is basicly a form
of sort routine. Each succeeding query You can do the maketable
query.promotes those entries it needs to, and leaves those that don't
behind.
Then build a select query. Put the new table in twice, joining the
Assembly on one with the components on the other. This will give you
all components that ALSO have an assembly.Change it to an update query.
for the first query: [ For every Component LEVEL ONE that has a
matching ASSEMBLY, (meaning it is also an assembly,) set the level to
TWO.]
put ONE in Criteria under BOMLEVEL for the COMPONENT linked side, and
TWO under the update cell of the SAME field.
Save that as "updateONEtoTWO"
Then for the next query, change the ONE in Criteria under BOMLEVEL for
the COMPONENT linked side to a TWO, and change the TWO under theUpdate
cell of the SAME field.to a THREE. Save that as "update TWO to THREE".
Lather rinse repeat.
Then create a macro to run each query starting with the maktable, then
"updateONEtoTWO", then "update TWOtoTHREE"., "updateTHREEtoFOUR"...
Then let engineering screw around with everything. when they are done,
just run the maco. It will create a new table, recalculate all of the
levels, and you will be on your way. (By the way, I am using WORDS like
ONE TWO THREE to eliminate confusion. I suggest you use 1,2,3, for
sorting purposes.
Each query will raise a smaller number of components
Now, their may be an issue with those assemblies that are NOT
components, meaning the first level. It is Friday, and my brain is not
fully functional. IF so, you may need to update those seperately with a
final update query. You would do this with the find unmatched query.
Once again, use the two tables, link assembly to component, to give you
those records from the ASSEMBLY joined table without matching COMPONENT
joined table. At the final stage of teh wizard, choose "modify query",
run it to make sure it works, then change it to an update query. Put
NINE, or whatever the highest level will be in the BOMLEVEL of the the
assembly records. This will be the last query to run.
Play with it a bit. It will probably be much more clear when you start
building the first queries.
Realize this is all off the top of my head after a long week, so it may
need to be tweaked a little bit, but once you start workign with it, I
think you will get the idea.