Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 22nd, 2004, 04:05 PM
Authorized User
Join Date: Jun 2003
Location: Ft. Lauderdale, Florida, USA.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Summarizing a filter

Hello Everyone!

I have an Access adp with a form that filters a subform. My problem is that when the form changes after the filter applies the summary of a field still displays the original total rather than the total for the filtered values.

Right now the summary field's control source = "=sum([field name])".

As far as how I am filtering the subform, it is standard VBA;

me.subformname.form.filter = "filter"
me.subformname.form.filteron = true

Any help is greatly appreciated.

Reply With Quote
  #2 (permalink)  
Old October 22nd, 2004, 06:32 PM
Authorized User
Join Date: Oct 2004
Location: Austin, TX, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts


You don't say which version of Access. Access 2000 ADPs are chock-full of bugs. You could try doing a Me.Refresh after applying the filter to see if that recalcs the the Sum in the subform. Or, you could get down and dirty and do Me.subformname.Requery to force it to refetch the data.

By the way, is your subform based on a View, Function, or Stored Procedure? If it's a View, then applying a filter by setting the Filter and FilterOn properties (Access 2002 or 2003) should send the filter to the server for execution (Access sets and sends the SeverFilter property). In Access 2000, you must explicitly set the ServerFilter property. If the form is based on a Function or SP, Access must still fetch the output of the SP or Function to the local machine and then apply the filter - not very efficient. You'd be better off using parameters and setting the Input Parameters property.

John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
Reply With Quote
  #3 (permalink)  
Old October 22nd, 2004, 07:36 PM
Authorized User
Join Date: Jun 2003
Location: Ft. Lauderdale, Florida, USA.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

Sorry for not statting the version (It's 2003), and more importantly thank you for replying.

As far as what it was bassed on, well I had tried every form from typing the actual select querry against the table to views and stored procedures (without parameters). That last one is the important one since that is actually how I got it to work after reading your reply.

I do not know if it was lazyness or grom going nuts staring at my screen all day.....
Anyway I deleted everything and started from scratch again this time taking notice of a section in the subform properties called "INPUT PARAMETERS", Duhhh on me!! So I wrote an sp with the two key parameters required to apropriately filter the list and set the "input parameters" value to look at the values in the fields in the main form and "CHACHING" it worked!

Thanks again for taking the time, I really do apreciate it.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BindingSource.Filter bufanator Visual Basic 2005 Basics 2 May 23rd, 2007 10:16 AM
Matrix filter jpenn Reporting Services 0 August 10th, 2006 03:46 PM
Filter Help mcloum Classic ASP Databases 2 November 10th, 2005 05:40 PM
Filter Help mcloum BOOK: Beginning ASP 3.0 1 August 26th, 2005 03:10 PM
How to Filter Cr 9.0 abdusalam Crystal Reports 0 June 25th, 2004 02:04 AM

All times are GMT -4. The time now is 07:18 PM.

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