Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 25th, 2006, 08:15 AM
Registered User
Join Date: Aug 2006
Location: Riyadh, Riyadh, Saudi Arabia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mackoy
Default 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.

Old August 25th, 2006, 12:27 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

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?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subform Filter based on Multiselect Combo boxes natwong Access 2 November 16th, 2006 10:05 AM
Subform Filter using Multiple Combo boxes natwong BOOK: Expert One-on-One Access Application Development 0 November 13th, 2006 03:07 PM
Filter Based Upon Logged In User LandOfToz BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 August 31st, 2004 12:24 PM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM
Filter subform from main form DBoulos Access VBA 2 October 30th, 2003 12:20 PM

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