Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    13

    Unanswered: "Enter Parameter Value" Appears Only When I Sort By a Field

    Hello,
    I use MS Access 2010, and I have queries with fields that sometimes refer to other fields in the same query.

    For example, one query has three fields, each of which calculate the sales reps' percentage to quota for the reps' three different quotas. Then there's another field that calculates the reps' average percent to quota for all three.

    This field calculates the correct amount, but if I include it in the "Order By" statement, then up pops the "Enter Parameter Value" dialog box. No matter what I type in the box, the query does not order by that field.

    So I guess I have two questions:
    1. Why can't Access sort by this field? If Access can calculate the field's values just fine, then sorting by those values should be a piece of cake, right?
    2. Why does Access give me the "Enter Parameter Value" input box when it makes absolutely no difference what I type into it?

    I realize that I would be able to get around this problem by making another query to refer to this one, but I already have multiple levels of queries referring to other queries; so I would rather keep the number of queries to a minimum.
    I realize that I would also be able to get around this problem by not referring to the other calculated fields in the query and instead typing in the full calculations that the first fields are based on; however, when I do this, it often says "The string returned by the builder was too long."

    Thank you very much for your help!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The problem is in the order of execution (certainly #2, maybe #1 as well). The WHERE clause is evaluated before the SELECT clause, thus any alias names created in the SELECT clause are unknown at that point in the query execution, thus the prompt.
    Paul

  3. #3
    Join Date
    Jan 2012
    Posts
    13
    Quote Originally Posted by pbaldy View Post
    The problem is in the order of execution (certainly #2, maybe #1 as well). The WHERE clause is evaluated before the SELECT clause, thus any alias names created in the SELECT clause are unknown at that point in the query execution, thus the prompt.
    Oh, I'm not using a WHERE clause for this query. Is the ORDER BY clause also evaluated before the SELECT clause? That would explain why Access thinks they are supposed to be input values. I was hoping that Access would have a way of magically checking the SELECT clause for matching field names before assuming unknown fields are supposed to be inputted by the user.

    I worked around the problem by creating a new set of queries.
    Thanks for your help.

Posting Permissions

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