Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    11

    Changing where clause in a query to run in a report

    I have a report based on the following saved Query:



    SELECT Crime_Table.Offense, Count(*) AS [Number of Crimes]
    FROM Crime_Table
    GROUP BY Crime_Table.Offense;

    What I want to do is be able to pass in a where clause that is generated from a form.

    Is this possible? Would I need to change the recordsource dynamically? if so how do I do this?

    Any help would be greatly appreciated.

  2. #2
    StepUP is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Dec 2005
    Posts
    99
    DoCmd.OpenReport "My Report", A_NORMAL, , "[MyCiteria]='" & Me.FilterField & "'"

    The last parameter is the equivalent of a Where clause.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. FROM Clause error message
    By skylite in forum Queries
    Replies: 2
    Last Post: 10-23-2008, 05:47 AM
  2. IIF clause
    By Peljo in forum Queries
    Replies: 2
    Last Post: 02-05-2008, 11:22 AM
  3. Replies: 0
    Last Post: 03-16-2006, 04:59 AM
  4. Help on WHERE clause
    By QBCM in forum Programming
    Replies: 1
    Last Post: 12-19-2005, 08:43 PM
  5. Replies: 2
    Last Post: 11-09-2005, 02:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums