Question: Parameter value query?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomas goodwin

    Question: Parameter value query?

    I have a query which asks for a parameter value to execute it.
    To see the results I have to:
    a) click on the query -- the "Enter Parameter Value" window pops up.
    b) enter the parameter value
    c) look at results in datasheet view

    If I want to run the query again, I must
    d) click to close the datasheet view
    e) click on the query
    f) enter the parameter value
    g) look at results in datasheet view

    Question: Is there a way to cut the number of steps in d) e) f) g) ?

    thanks,
    tom g

  • Allen Browne

    #2
    Re: Question: Parameter value query?

    Refer to a text box on a form instead of using a parameter.

    Typically you type something like this into the Criteria row in query
    design:
    [Forms]![MyForm]![MyTextbox]

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "thomas goodwin" <tom_goodwin@un c.edu> wrote in message
    news:408001ce_3 @news.unc.edu.. .[color=blue]
    > I have a query which asks for a parameter value to execute it.
    > To see the results I have to:
    > a) click on the query -- the "Enter Parameter Value" window pops up.
    > b) enter the parameter value
    > c) look at results in datasheet view
    >
    > If I want to run the query again, I must
    > d) click to close the datasheet view
    > e) click on the query
    > f) enter the parameter value
    > g) look at results in datasheet view
    >
    > Question: Is there a way to cut the number of steps in d) e) f) g) ?
    >
    > thanks,
    > tom g[/color]


    Comment

    • David B

      #3
      Re: Question: Parameter value query?


      thomas goodwin <tom_goodwin@un c.edu> wrote in message
      news:408001ce_3 @news.unc.edu.. .[color=blue]
      > I have a query which asks for a parameter value to execute it.
      > To see the results I have to:
      > a) click on the query -- the "Enter Parameter Value" window pops up.
      > b) enter the parameter value
      > c) look at results in datasheet view
      >
      > If I want to run the query again, I must
      > d) click to close the datasheet view
      > e) click on the query
      > f) enter the parameter value
      > g) look at results in datasheet view
      >
      > Question: Is there a way to cut the number of steps in d) e) f) g) ?
      >
      > thanks,
      > tom g[/color]

      Much prefer doing this from a form.
      Place a text box on a form (frmsearch). Call it say txtsearch.

      in the query criteria put [Forms]![frmsearch]![txtsearch] - assuming you have
      the names above.

      by viewing query results in a form you have many more options as to how the data
      is displayed.

      So create a new form and use your query as it`s record source. the wizard will
      do this for you.

      On your search form add a command button to open your results form.
      Depending on what you are seaching for using a combo box to select the criteria
      works well.

      You can also add 2 text boxes (formated to date) on your search form which
      allows you to search between 2 dates

      You would need something like this in the query date field criteria - Between
      [Forms]![frmsearch]![firstdate] And [Forms]![frmsearch]![lastdate]

      HTH
      David B




      Comment

      • David W. Fenton

        #4
        Re: Question: Parameter value query?

        "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in
        news:40800d11$0 $16572$5a62ac22 @freenews.iinet .net.au:
        [color=blue]
        > Refer to a text box on a form instead of using a parameter.
        >
        > Typically you type something like this into the Criteria row in
        > query design:
        > [Forms]![MyForm]![MyTextbox][/color]

        You can improve the performance of a query by defining the argument
        as a parameter and typing it. I do this whenever I save a query that
        is filtered on a form field.

        --
        David W. Fenton http://www.bway.net/~dfenton
        dfenton at bway dot net http://www.bway.net/~dfassoc

        Comment

        Working...