Filtering subform between date (1 Viewer)

theinviter

Registered User.
Local time
Today, 11:04
Joined
Aug 14, 2014
Messages
240
Dears;
I have created Inventory form "Table1" has a sub form "Table2" so the date filter filed ( From ) (to) present in table1 . i want to filter the subform "Date_" after updating date filter filed to get record between selected dates.
so can you advise how to do it.


thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:04
Joined
Feb 19, 2002
Messages
43,229
I never use filters for reasons not relevant to this question, but I think that you can't use a filter on a subform so I'll tell you how I do this.

The RecordSource query for the subform has a Where clause:

Where SomeDate Between Forms!mainform!FromDate and Forms!mainformThruDate

Then add a "filter" command to the main form. In the click event of that button, requery the subform:
Me.sfrmName.Requery

NOTE, make sure that "sfrmName" = the name of the subform CONTROL which might be different from the name of the subform loaded into the subform control.
 

Users who are viewing this thread

Top Bottom