Use value on main form for criteria on subform

S

Sammie

How do I pass a date on a main form to the criteria of a subform?

Main form: Inventory
Bound Field: ProductID
Controlname: InventoryDate

Subform: InventorySubform1
Bound Field: ProductID
Query: Inventory Purchase Query
Field needing criteria: OrderDate
Criteria should be: OrderDate between [inventory].[form]![InventoryDate]
and #1/1/2010#

I need it to stay synchronized when the InventoryDate changes on the main
form.
 
K

Klatuu

If your subform is based on a query, you could put the criteria in the
subform's recordset query and in the after update event of InventoryDate,
requery the subform.
 
Top