A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ACC2000: changing report .Filter does not work



 
 
Thread Tools Display Modes
  #1  
Old January 29th, 2008, 05:04 PM posted to microsoft.public.access.reports
A Man
external usenet poster
 
Posts: 29
Default ACC2000: changing report .Filter does not work

I'm still working on issues in earlier threads. When I use code to
change my report's .Filter and set .FilterOn to true, I get no records.
When I manually go to the report design, change the .Filter and
..FilterOn, I also get no records.

Here's the code I use to change .Filter via code:

sWhere = "[cus_no] = '" & sCustnum & "'"
DoCmd.OpenReport sReportname, acViewDesign ' Must come before "set rpt"
Set rpt = Reports(sReportname)
rpt.Filter = sWhere
rpt.FilterOn = True
DoCmd.Close , , acSaveYes
DoEvents ' Allow Access to save report.


What's wrong?
Why is Access ignoring the .Filter property even though .FilterOn is
True (or Yes in the property box).

  #2  
Old January 29th, 2008, 05:11 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default ACC2000: changing report .Filter does not work

Why are you doing this the hard way. Why not just use

sWhere = "[cus_no] = '" & sCustnum & "'"
Docmd.OpenReport sReportName,acViewPreview,,strWhere

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"A Man" wrote in message
. net...
I'm still working on issues in earlier threads. When I use code to
change my report's .Filter and set .FilterOn to true, I get no records.
When I manually go to the report design, change the .Filter and
.FilterOn, I also get no records.

Here's the code I use to change .Filter via code:

sWhere = "[cus_no] = '" & sCustnum & "'"
DoCmd.OpenReport sReportname, acViewDesign ' Must come before "set rpt"
Set rpt = Reports(sReportname)
rpt.Filter = sWhere
rpt.FilterOn = True
DoCmd.Close , , acSaveYes
DoEvents ' Allow Access to save report.


What's wrong?
Why is Access ignoring the .Filter property even though .FilterOn is
True (or Yes in the property box).



  #4  
Old January 29th, 2008, 07:16 PM posted to microsoft.public.access.reports
A Man
external usenet poster
 
Posts: 29
Default ACC2000: changing report .Filter does not work

As a side note, when I go to the report in design mode, I enter this for
the .Filter:
[cus_no] = '000000080000'

That is a valid field name and customer number. I double checked both.
But I still get no records when I do a report preview. FilterOn is Yes
in the Properties window.

In the Help, About box the version says "Access 2000 (9.0.2720)". I
don't see a service pack listed, do I need one to resolve a report
filter bug?

I'm having a similar problem as posted on 11/13/07 to this same
newsgroup. The .Filter property forces the report to return no records.


Thanks.

 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.