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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Requery in a report
One of my reports needs to set a filter and
"Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
#2
|
|||
|
|||
Requery in a report
Using the Where clause in the DoCmd.OpenReport is the method I tend to use.
If FamilyDuplex is a text field, you need to use something like: DoCmd.OpenReport "rptYourRpt", acPreview, _ , "FamilyDuplex = """ & GrpExp & """" -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... One of my reports needs to set a filter and "Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
#3
|
|||
|
|||
Requery in a report
Thanks, I was suspicious that I didn't have the syntax
correct on the "Where" parameter to OpenReport. I'll try that now. Thanks again, Bill "Duane Hookom" wrote in message ... Using the Where clause in the DoCmd.OpenReport is the method I tend to use. If FamilyDuplex is a text field, you need to use something like: DoCmd.OpenReport "rptYourRpt", acPreview, _ , "FamilyDuplex = """ & GrpExp & """" -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... One of my reports needs to set a filter and "Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
#4
|
|||
|
|||
Requery in a report
Duane,
I observe Me.Filter to be the expression that was passed as the "Where" clause to the OpenReport. However, it's not at all clear at what stage of processing in the report that the value of Me.Filter is available for inspection from code. I.e., in the OnOpen code sometimes Me.Filter is set per the "Where" and other times it's empty. Is there some sort of inherent delay or something like that? Thanks, Bill "Duane Hookom" wrote in message ... Using the Where clause in the DoCmd.OpenReport is the method I tend to use. If FamilyDuplex is a text field, you need to use something like: DoCmd.OpenReport "rptYourRpt", acPreview, _ , "FamilyDuplex = """ & GrpExp & """" -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... One of my reports needs to set a filter and "Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
#5
|
|||
|
|||
Requery in a report
I moved my "inspection" code to the OnFormat of the
ReportHeader section and consistently find the expression that was passed as the "Where" clause. That will solve my needs, but I still don't understand the opening sequence and exactly at what point Me.Filter is available to code? Thanks, Bill "Bill" wrote in message ink.net... Duane, I observe Me.Filter to be the expression that was passed as the "Where" clause to the OpenReport. However, it's not at all clear at what stage of processing in the report that the value of Me.Filter is available for inspection from code. I.e., in the OnOpen code sometimes Me.Filter is set per the "Where" and other times it's empty. Is there some sort of inherent delay or something like that? Thanks, Bill "Duane Hookom" wrote in message ... Using the Where clause in the DoCmd.OpenReport is the method I tend to use. If FamilyDuplex is a text field, you need to use something like: DoCmd.OpenReport "rptYourRpt", acPreview, _ , "FamilyDuplex = """ & GrpExp & """" -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... One of my reports needs to set a filter and "Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
#6
|
|||
|
|||
Requery in a report
The filter property will be available in any On Format or On Print event.
You can also bind the filter property to a text box like: ="Current Report Filter: " & [Filter] -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... I moved my "inspection" code to the OnFormat of the ReportHeader section and consistently find the expression that was passed as the "Where" clause. That will solve my needs, but I still don't understand the opening sequence and exactly at what point Me.Filter is available to code? Thanks, Bill "Bill" wrote in message ink.net... Duane, I observe Me.Filter to be the expression that was passed as the "Where" clause to the OpenReport. However, it's not at all clear at what stage of processing in the report that the value of Me.Filter is available for inspection from code. I.e., in the OnOpen code sometimes Me.Filter is set per the "Where" and other times it's empty. Is there some sort of inherent delay or something like that? Thanks, Bill "Duane Hookom" wrote in message ... Using the Where clause in the DoCmd.OpenReport is the method I tend to use. If FamilyDuplex is a text field, you need to use something like: DoCmd.OpenReport "rptYourRpt", acPreview, _ , "FamilyDuplex = """ & GrpExp & """" -- Duane Hookom MS Access MVP -- "Bill" wrote in message ink.net... One of my reports needs to set a filter and "Requery" the RecordSource accordingly. The filter expression is obtained via a public variable, an O2K necessity with reports, but when I code Me.Requery after having set the filter the Me.Requery raises an error. I tried passing the filter expression via the DoCmd.OpenReport Where clause, but that doesn't seem to work, or I don't have the syntax correct? E.g., "FamilyDuplex = " & GrpExp Apparently the Requery method is not valid in reports. How do I accomplish this task? Thanks, Bill |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reporting subreport total on main report | BobV | Setting Up & Running Reports | 22 | November 1st, 2005 03:19 AM |
To Sharkbyte and all: Calculate a total values in group level | Ally | General Discussion | 6 | June 13th, 2005 08:16 PM |
Set up a report using more than one query | jbeck2010 | Database Design | 6 | February 12th, 2005 06:59 AM |
Help!! I'm running around in circles! | CathyA | New Users | 19 | December 12th, 2004 07:50 PM |
Save Report With CreateReport Coding Issue | Jeff Conrad | Setting Up & Running Reports | 8 | July 12th, 2004 08:39 AM |