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
|
|||
|
|||
How do I filter an Access report?
How do I apply a filter to an Access report? I seriously cannot find any
examples anywhere. Well, MS says this works: #2/2/2006# and #2/4/2006# .... but all I get is "missing operator". It then strikes me I haven't told it what to filter on. What's the syntax for it? I have a table called "Inventory Transactions" and need the field "Transaction Date" filtered by the above criteria (different date range but the above example will do). I tried this: [Inventory Transactions].[Transaction Date]=#1/1/2009# And [Inventory Transactions].[Transaction Date]=#12/31/2009# ....but all it does is prompt me for a value. - ? Any ideas? Thanks! |
#2
|
|||
|
|||
How do I filter an Access report?
You can filter a report by filtering the query the report is based on. What
value are you getting prompted for? I typically open a report with code using the DoCmd.OpenReport method. You can add a WHERE CONDITION to this. Dim strWhere as String strWhere = "[Transaction Date] Between #1/1/2009# And #12/31/2009#" DoCmd.OpenReport "rptMyReportName", acPrintPreview , , strWhere -- Duane Hookom Microsoft Access MVP "Meshman" wrote: How do I apply a filter to an Access report? I seriously cannot find any examples anywhere. Well, MS says this works: #2/2/2006# and #2/4/2006# ... but all I get is "missing operator". It then strikes me I haven't told it what to filter on. What's the syntax for it? I have a table called "Inventory Transactions" and need the field "Transaction Date" filtered by the above criteria (different date range but the above example will do). I tried this: [Inventory Transactions].[Transaction Date]=#1/1/2009# And [Inventory Transactions].[Transaction Date]=#12/31/2009# ...but all it does is prompt me for a value. - ? Any ideas? Thanks! |
#4
|
|||
|
|||
How do I filter an Access report?
Meshman wrote:
How do I apply a filter to an Access report? I seriously cannot find any examples anywhere. Well, MS says this works: #2/2/2006# and #2/4/2006# ... but all I get is "missing operator". It then strikes me I haven't told it what to filter on. What's the syntax for it? I have a table called "Inventory Transactions" and need the field "Transaction Date" filtered by the above criteria (different date range but the above example will do). I tried this: [Inventory Transactions].[Transaction Date]=#1/1/2009# And [Inventory Transactions].[Transaction Date]=#12/31/2009# ...but all it does is prompt me for a value. - ? I think you put that filter criteria in the wrong place, but you did not say where/how you are trying to use that criteria. When you are prompted for sumething, it means that the thing you are prompted for is not in the report's record source table/query (a typo?) -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
How do I filter an Access report?
Apparently, this is the answer:
"[Inventory Transactions].[Transaction Date] = #" & 1/1/2009 & "#" & " And [Inventory Transactions].[Transaction Date] = # " & 12/31/2009 & "#" ....and it doesn't work either but it doesn't return any errors. The report contains ALL records, even with this criteria. I had to go into the recordsource and add the criteria in there. "Meshman" wrote: How do I apply a filter to an Access report? I seriously cannot find any examples anywhere. Well, MS says this works: #2/2/2006# and #2/4/2006# ... but all I get is "missing operator". It then strikes me I haven't told it what to filter on. What's the syntax for it? I have a table called "Inventory Transactions" and need the field "Transaction Date" filtered by the above criteria (different date range but the above example will do). I tried this: [Inventory Transactions].[Transaction Date]=#1/1/2009# And [Inventory Transactions].[Transaction Date]=#12/31/2009# ...but all it does is prompt me for a value. - ? Any ideas? Thanks! |
Thread Tools | |
Display Modes | |
|
|