cascading combo boxes is probably one of the most asked questions thus there are TONS of posted examples. If that's what you're asking how to do it doesn't make a whole lot of sense to repeat it here.
If you're asking how to pass only the value from combo A to a query, or combo A AND combo B (but not combo B alone) this is best done via code. The code constructs the SELECT portion of a query, then if combo A is not null, adds its selected value as part of the WHERE clause. If combo B is not null, it adds that to the WHERE clause as well. If not, it just goes with the first part. Then you execute the constructed sql statement in code. Otherwise, you'd have to use 2 queries - one for A and one for A AND B and find a way to know which one to run. I think code is the only realistic option if you want to be able to allow A or B as well as A and B,
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.