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.
 

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

Top