[AccessD] Report Filter Problem

Jim Lawrence accessd at shaw.ca
Tue Dec 4 18:27:31 CST 2007


Hi Rocky:

Can I assume the query if actually 

Select * from table where difference >= .01 changed to select * from table
where difference > 1

Is this query actually run against a combined query used in the report? I
have found that sometimes a combined query does not work as planned. When
you run this query directly against the report query/table does it work? Try
putting brackets around the filter like:

"(difference > 1.0)" and see if that produces any change.

Jim   

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Tuesday, December 04, 2007 10:10 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Report Filter Problem

Dear List:
 
I have a report grouped on Product.  In the detail there are two number -
standard and actual cost.  There's an option on the calling form to print
all records or only records where the difference is > .01.  In the report's
Open event, then, I set the filter:
 
    If Forms!frmPricePaidVersusContractReport!fraPrint = 1 Then
        Me.Filter = ""
        Me.FilterOn = False
    Else
        Me.Filter = "Difference >=.01"
        Me.FilterOn = True
    End If

All's well so far.
 
Then the client said to change the report so that if the option to print
only if DIFFERENCE > .01 and ANY ONE record in the product qualified, then
print all records for that product.
 
So in the format event of the header of the Product I do a little code to
see if ANY ONE record qualifies and if so I turn the filter off:
 
ShowDetail:
    Me.Filter = ""
    Me.FilterOn = False

and then in the Format event of the Product Footer I conditionally turn the
filter back on again with same code  I used in the open event.
 
Problem is that it goes into a loop which I traced down to the report being
run over and over again.  I put a break point in the Open event, and it just
keeps running the report again and again.
 
What is going wrong here - or better yet - what's the solution?
 
MTIA
 
Rocky
 
 
 
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list