473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Access Query Prompting for Value

MX1
I have query2 that sums a set of fields from query1. Works fine. However,
when I try to add two of the calculated fields from query2, I get prompted
for the label I gave the fields. I just hit enter and it gives me my data.
Any thoughts regarding why I'd get prompted for the field name on a
caluclated field when I try to use it in another calcuated field?

thanks! :)
Nov 12 '05 #1
5 2017
MX1 wrote:
I have query2 that sums a set of fields from query1. Works fine.
However, when I try to add two of the calculated fields from query2,
I get prompted for the label I gave the fields. I just hit enter and
it gives me my data. Any thoughts regarding why I'd get prompted for
the field name on a caluclated field when I try to use it in another
calcuated field?


The usual suspect:
If you put a sort or criteria on a field that uses the name of a
calculated field Access doesn't recognice the calculated field
in the ORDER BY or WHERE part of the query and prompts
you for the value.
Instead of reusing the name of the calculated field you have
to repeat its calculation to avoid the prompt.

--
HTH
Karl
*********
Access-FAQ (German): http://www.donkarl.com
Nov 12 '05 #2
can you post the two queries ?

"MX1" <mx*@mx1.abc> wrote in message news:<3M1Qb.101763$Rc4.684691@attbi_s54>...
I have query2 that sums a set of fields from query1. Works fine. However,
when I try to add two of the calculated fields from query2, I get prompted
for the label I gave the fields. I just hit enter and it gives me my data.
Any thoughts regarding why I'd get prompted for the field name on a
caluclated field when I try to use it in another calcuated field?

thanks! :)

Nov 12 '05 #3
MX1
Here you go. I keep getting prompted for Customer? which is correct, but it
also prompts me for Discount Total. I leave it blank, hit enter and it
works. How do I get rid of Discount Total prompt?

Order Query 1:

SELECT tblOrder.CustomerID, tblOrder.AccountID, tblOrder.InvoiceNum,
tblMaster.First, tblMaster.Middle, tblMaster.Last, tblOrder.SellersFee,
nz([PurchaseAmt],0) AS PurchaseAmt1, nz([Percent],0) AS Percent1,
CCur(Format(([PurchaseAmt1]*([Percent1]/100))/2,'Standard')) AS
LineItemSubtotal
FROM tblMaster INNER JOIN (tblOrder LEFT JOIN tblOrderDetail ON
tblOrder.InvoiceNum=tblOrderDetail.InvoiceNum) ON
tblMaster.AccountID=tblOrder.AccountID
WHERE (((tblOrder.CustomerID)=[Customer?]) And ((tblOrder.InvoiceTypeID)=1))
Or (((tblOrder.InvoiceTypeID)=1) And (((tblOrder.CustomerID) Like
[Customer?]) Is Null))
ORDER BY tblOrder.InvoiceNum;

Order Query2:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtotal) AS [Discount Total],
[SellersFee]+[Discount Total] AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+[Discount Total]
ORDER BY [OrderQuery1].InvoiceNum;
"Roger" <le*********@natpro.com> wrote in message
news:8c**************************@posting.google.c om...
can you post the two queries ?

"MX1" <mx*@mx1.abc> wrote in message

news:<3M1Qb.101763$Rc4.684691@attbi_s54>...
I have query2 that sums a set of fields from query1. Works fine. However, when I try to add two of the calculated fields from query2, I get prompted for the label I gave the fields. I just hit enter and it gives me my data. Any thoughts regarding why I'd get prompted for the field name on a
caluclated field when I try to use it in another calcuated field?

thanks! :)

Nov 12 '05 #4
MX1 wrote:
Here you go. I keep getting prompted for Customer? which is correct, but
it also prompts me for Discount Total. I leave it blank, hit enter and it
works. How do I get rid of Discount Total prompt?
...
Order Query2:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtotal) AS [Discount Total],
[SellersFee]+[Discount Total] AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+[Discount
Total] ORDER BY [OrderQuery1].InvoiceNum;


Same thing I mentionned above for sort and order applies to grouping.
You have to replace the name of the calculated field by its expression
if you want to reuse it in another grouped field. At a first glance that
should be:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtotal) AS [Discount Total],
[SellersFee]+Sum([OrderQuery1].LineItemSubtotal) AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+
Sum([OrderQuery1].LineItemSubtotal)
ORDER BY [OrderQuery1].InvoiceNum;

BTW DISTINCTROW is useless if you only have 1 source.

--
HTH
Karl
*********
Access-FAQ (German): http://www.donkarl.com
Nov 12 '05 #5
MX1
Got it. Thanks!

"Karl Donaubauer" <No****@donkarl.com> wrote in message
news:bu************@ID-46617.news.uni-berlin.de...
MX1 wrote:
Here you go. I keep getting prompted for Customer? which is correct, but it also prompts me for Discount Total. I leave it blank, hit enter and it works. How do I get rid of Discount Total prompt?
...
Order Query2:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtotal) AS [Discount Total],
[SellersFee]+[Discount Total] AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+[Discount
Total] ORDER BY [OrderQuery1].InvoiceNum;


Same thing I mentionned above for sort and order applies to grouping.
You have to replace the name of the calculated field by its expression
if you want to reuse it in another grouped field. At a first glance that
should be:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtotal) AS [Discount Total],
[SellersFee]+Sum([OrderQuery1].LineItemSubtotal) AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+
Sum([OrderQuery1].LineItemSubtotal)
ORDER BY [OrderQuery1].InvoiceNum;

BTW DISTINCTROW is useless if you only have 1 source.

--
HTH
Karl
*********
Access-FAQ (German): http://www.donkarl.com

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. ...
8
by: Steven Stewart | last post by:
Hi there, I have a query (QueryB) that is based on the results of another query (QueryA). When I open QueryB itself, it displays the exact records that I want. I have a report based on...
2
by: Raj | last post by:
Hi, Does anybody know how to call an oracle stored procedure ( with parameters ofcourse) from MS Access 2002. I want to invoke an oracle stored procedure which takes 2 parameters. Thanks,...
14
by: Scott Gorman | last post by:
I have a report with a sub report for an income / expense report for church. My expense report is the sub report. My question is, when I run the report, it prompts me 2-3 times for the parameters...
2
by: robin9876 | last post by:
For a query that has two parameters for a start and end date, is it possible to send the parameters values when the query is used by a report instead of prompting the user? I do not want to add...
2
by: TechBoy | last post by:
I am trying to learn on the fly about Access Security for an app we are developing. I realize Access security is an advanced subject with many details. I wanted to share a scenario and ask a...
1
by: danijela.simunovic | last post by:
Hi! Is there a way that when I run a "make table query" and an "append query" that i won't be asked those 2 or 3 questions from access like :"you are about to run a make table...","the existing...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
3
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net page, it uses js to print in IE. It always has the prompting user window appear. I have tried: <input onclick="document.all.WebBrowser.ExecWB(6,6)" type="button"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.