p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   Filter a subform based on value entered (http://p2p.wrox.com/showthread.php?t=46964)

mackoy August 25th, 2006 08:15 AM

Filter a subform based on value entered
Hi! Im just new here and can anybody would assist me with my problem regarding filtering subform based on "Between two fields value".

I have a main form consisting of the following fields.

Account No
From Period
To Period

The Subform Consists of the following fields

Account No
Net Amount

My problem is how can i filter the subforms 'Period' field based only on the field value that i entered in the Forms 'From Period' And 'To Period'

Hope anyone would help on this.

mmcdonal August 25th, 2006 12:27 PM

Are you sure you don't want a report for this? A subform connotes data enrtry. If you want to display a certain period of time, you would do that in a report.

In any event, base the subform on a query, and put the following criteria in the period field:

BETWEEN [Forms]![frmYourMainFormName].[FromPeriod] AND [Forms]![frmYourMainFormName].[ToPeriod]

When the subform opens, it should contain only those values in the period.

Be sure to set the Parent Child link on the subform to the Account No.

Did that work?


All times are GMT -4. The time now is 09:42 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.