Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 October 14th, 2003, 05:13 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Filter subform from main form

I have a read only subform on a main form. The subform has a few hundred records with a particular field called txtInvoiceDate which holds a date,(medium date format).
The records on the subform, are over the course of a whole year.
With 12 command buttons on the main form (one for each month), i would like to filter the subform into one particular month for that year, using one of the command buttons on the main form that corresponds with that particular month.
Any help would be appreciated, Thank you!
 
Old October 15th, 2003, 09:08 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create an SQL statement for whatever is selected, set the recordsource for the sub form to be that SQL statement, then requery the subform. (or refresh)

John
 
Old October 30th, 2003, 12:20 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

John thank-you very much for your response, it's worked very well.
I simply made a command button that when clicked, put my SQL statement
on the recordsource property of the subform. For my intent and purpose, works like a charm.
Thanks again!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Synchronizing main form w/subform (i.e. backward) paladin Access VBA 7 April 19th, 2007 06:40 AM
Moving total from Subform to Main Form Shepwad Access 1 March 10th, 2006 10:57 AM
updating main form from subform dartcoach Access 6 April 28th, 2005 08:27 AM
how to parse filter from a form to a main form flyfish Access 1 February 1st, 2005 05:36 AM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM





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