parameter query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TFerg
    New Member
    • Oct 2008
    • 1

    parameter query

    How can I develop a prompt which would specify certain data when run on Access?
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Depends how sophisticated you want to make the question/response process. As you don't give us any details of what you want to do it is not easy to guide you here.

    Simplest way within the Access Query Editor is to enter a prompt in the criteria section of any field, for example to match a name you could enter something like this as the criterion:

    like "*" & [Enter the name you want to find] & "*"

    This will pop up a question box and ask the user for the name to find each time the query is run.

    A much better way is to use a simple form with one or more textboxes for the user to fill in and a command button to do whatever is necessary when the user is ready. The query (or report or whatever) can then be filtered at run-time on what the user enters. This is much, much more flexible than hard-coding parameters into the underlying query.

    There are many other ways to do it (including setting parameters in code, passing values to forms and reports, etc), but investigating the two mentioned should get you going for now.

    Welcome to Bytes!

    -Stewart

    Comment

    Working...