Results 1 to 8 of 8
  1. #1
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63

    Query asks parameters for Calculated Fields

    My query has a parent and child tables. When I run the query, every time it asks me to enter parameters for some calculated fields.
    Please notice that, in the query design, parent table is a connected through Left Jion with child table

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    a query will ask you for param usu because the query cant find the field:
    1. you misspelled a field
    2. you used a path to reference a field on a form ,but the path is incorrect. (use the builder to get the path names correct)
    usu: forms!myform!cboBox
    or forms!myForm!subform!form!textBox

  3. #3
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    Thank you, but I have already checked for misspelled fields. In fact I am trying to create a calculate field based on other calculated fields in the query and query does show the valid results too, but before displaying the results, it asks for parameters which I think it should not

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Post the SQL.

  5. #5
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    Orders Query Requesting Parameters, why?
    This is my SQL query, please check and reply

    SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.VehicleID, Orders.DispatchDate, Orders.FixedWeight, Orders.RealWeight, [FixedWeight]-[RealWeight] AS ExtraWeight, Orders.NetFrt, Orders.Brokerage, Sum(OrderDetails.ExpAmount) AS Expenses, Sum(OrderDetails.RcvdFrt) AS TotalRcvdFrt, [NetFrt]+[Expenses] AS Receivable, [Brokerage]+[TotalRcvdFrt] AS Receivings, [Receivable]-[Receivings] AS OrderBalance
    FROM Orders LEFT JOIN OrderDetails ON Orders.OrderID = OrderDetails.OrderID
    GROUP BY Orders.OrderID, Orders.CustomerID, Orders.VehicleID, Orders.DispatchDate, Orders.FixedWeight, Orders.RealWeight, [FixedWeight]-[RealWeight], Orders.NetFrt, Orders.Brokerage, [NetFrt]+[Expenses], [Brokerage]+[TotalRcvdFrt], [Receivable]-[Receivings]
    HAVING (((Orders.CustomerID)=1));

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Check all the fields in square brackets to make sure that they exist on a table, e.g. change [Expenses] to use fields from the table, as well as the other calculated fields.

  7. #7
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    some things to try:
    - wrap the calculations ([FixedWeight]-[RealWeight])
    - use the complete reference (if the fields exist in both tables, it's certainly ambiguous) Orders.[FixedWeight]-Orders.[RealWeight]
    - don't repeat the calculation in an ORDER BY clause: not "...Orders.RealWeight, [FixedWeight]-[RealWeight]" but ..."Orders.RealWeight, ExtraWeight..."
    - create a select query that's based on the TOTALS query (where you do the calculations) or the other way around.
    If none of that helps, post which fields are causing prompts so we can zero in.
    Last edited by Micron; 03-13-2017 at 10:34 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    I deleted all resulting calculated field names after GROUP BY clause in SQL view, and it worked, no more parameter requests

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

Similar Threads

  1. Use calculated fields of the same query
    By paultje_bos in forum Queries
    Replies: 1
    Last Post: 09-20-2016, 05:53 AM
  2. Update query with calculated fields?
    By shaunacol in forum Queries
    Replies: 9
    Last Post: 07-09-2015, 01:32 PM
  3. Query Design - Calculated Fields
    By roarcrm in forum Queries
    Replies: 6
    Last Post: 06-26-2014, 12:14 PM
  4. Replies: 12
    Last Post: 10-01-2013, 12:59 PM
  5. Replies: 2
    Last Post: 06-10-2012, 01:10 PM

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