Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2009
    Location
    Canberra
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello

    I am creating a simple access form to filter on Queries, and Reports.

    I have added several controls to the form where the user selects the date, state, etc...

    When I run the command, "Docmd.Openreport" I use the wherecondition to open the report with the selected values.

    Is there a way to run queries "Docmd.OpenQuery" with a wherecondition?

    Thanks
    Marie-Therese

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome (back) to the Lounge!

    No, DoCmd.OpenQuery doesn't let you specify a where-condition, only a view mode and a data mode.

    In general, this should not be a problem since end users shouldn't use a query (or table) to view data, but a form or report.

    If really necessary, you could change the SQL of a query using VBA before opening it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •