473,665 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2030
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.101 763$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.Custom erID, tblOrder.Accoun tID, tblOrder.Invoic eNum,
tblMaster.First , tblMaster.Middl e, tblMaster.Last, tblOrder.Seller sFee,
nz([PurchaseAmt],0) AS PurchaseAmt1, nz([Percent],0) AS Percent1,
CCur(Format(([PurchaseAmt1]*([Percent1]/100))/2,'Standard')) AS
LineItemSubtota l
FROM tblMaster INNER JOIN (tblOrder LEFT JOIN tblOrderDetail ON
tblOrder.Invoic eNum=tblOrderDe tail.InvoiceNum ) ON
tblMaster.Accou ntID=tblOrder.A ccountID
WHERE (((tblOrder.Cus tomerID)=[Customer?]) And ((tblOrder.Invo iceTypeID)=1))
Or (((tblOrder.Inv oiceTypeID)=1) And (((tblOrder.Cus tomerID) Like
[Customer?]) Is Null))
ORDER BY tblOrder.Invoic eNum;

Order Query2:

SELECT DISTINCTROW [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee,
Sum([OrderQuery1].LineItemSubtot al) 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*********@na tpro.com> wrote in message
news:8c******** *************** ***@posting.goo gle.com...
can you post the two queries ?

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

news:<3M1Qb.101 763$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].LineItemSubtot al) 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].LineItemSubtot al) AS [Discount Total],
[SellersFee]+Sum([OrderQuery1].LineItemSubtot al) AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+
Sum([OrderQuery1].LineItemSubtot al)
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].LineItemSubtot al) 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].LineItemSubtot al) AS [Discount Total],
[SellersFee]+Sum([OrderQuery1].LineItemSubtot al) AS [Invoice Total]
FROM [OrderQuery1]
GROUP BY [OrderQuery1].CustomerID, [OrderQuery1].AccountID,
[OrderQuery1].InvoiceNum, [OrderQuery1].First, [OrderQuery1].Middle,
[OrderQuery1].Last, [OrderQuery1].SellersFee, [SellersFee]+
Sum([OrderQuery1].LineItemSubtot al)
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
11692
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. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry (Access form used to enter data) spGetCustomerInformation (Stored Procedure which returns data using...
8
3246
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 QueryB, and when I open it directly, it displays what I want. When I open the report from a command button on a form using this code:
2
4364
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, Raj.
14
10622
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 of the expense report. Is there a way around this annoyance? Thank you for your help. Scott *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
1492
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 the !! in to the query as it then makes the query useable from only that one form.
2
1846
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 couple of questions. Scenario: I have MyApp.MDB up on a file server. I also have two Client PC's: Client1 and Client2 who use MyApp. (Both Client's are running Access 2002) On Client1's PC:
1
2538
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 table ABCDE will be deleated..." and so on prompting for yes or no! I would like to make a command button which would prompt me for yes or no and then if i say "yes" it would first run the make table query and then the append query without...
6
5220
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. Again, I have this part working. But the fields in the resulting spreadsheet are in a different order than the Access report. (Example: The fields in the Access report might go FirstName, LastName,Address,City--in the Excel spreadsheet, they come up...
3
3278
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" value="Print directly"> <input onclick="document.all.WebBrowser.ExecWB(6,2)" type="button" value="Print directly">
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.