A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Why am I asked to enter parameter value?



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2006, 05:51 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

My query calculates the percent of hours worked on a project compared
to total hours worked. Here are the relevant fields:

Field: HoursWorked
Table: MainProjectTable
Total: Sum

Field: SumofHoursWorked
Table: qryTtlHrs

Field:Percent: [SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked

When I run the query I'm asked to enter parameter value for
[SumOfHoursWorked1] even though the criteria row is empty for all of
these fields. I hit OK and the query runs perfectly. How do I get rid
of the Enter Parameter Message Box? Any help would be much
appreciated. Thanks in advance.

-JZ

  #2  
Old May 16th, 2006, 06:11 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

It is prompting for that because you did not tell it where to find the data --
Field:Percent: [SumOfHoursWorked1] /qryTtlHrs!SumOfHoursWorked

"JZ" wrote:

My query calculates the percent of hours worked on a project compared
to total hours worked. Here are the relevant fields:

Field: HoursWorked
Table: MainProjectTable
Total: Sum

Field: SumofHoursWorked
Table: qryTtlHrs

Field:Percent: [SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked

When I run the query I'm asked to enter parameter value for
[SumOfHoursWorked1] even though the criteria row is empty for all of
these fields. I hit OK and the query runs perfectly. How do I get rid
of the Enter Parameter Message Box? Any help would be much
appreciated. Thanks in advance.

-JZ


  #3  
Old May 16th, 2006, 06:47 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

Thanks for the response Karl. I built Percent:
[SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked in the expression
builder. Access added the 1 at the end of [SumOfHoursWorked1] because
I am dividing two different sums of the same HoursWorked field. I
tried
[qryPrcnt]![SumOfHoursWorked] /[qryTtlHrs]![SumOfHoursWorked],
where qryPrcnt is the query I'm working on, but that did not work. Any
suggestions on what to try next?

-JZ

  #4  
Old May 16th, 2006, 07:02 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

Percent is actual divided by possible. Unless you use a subquery you will
not have the possible to divide unto the actual.

You can use a totals query to get the possible or assume a fixed number for
the possible like 8 hours per day.

"JZ" wrote:

Thanks for the response Karl. I built Percent:
[SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked in the expression
builder. Access added the 1 at the end of [SumOfHoursWorked1] because
I am dividing two different sums of the same HoursWorked field. I
tried
[qryPrcnt]![SumOfHoursWorked] /[qryTtlHrs]![SumOfHoursWorked],
where qryPrcnt is the query I'm working on, but that did not work. Any
suggestions on what to try next?

-JZ


  #5  
Old May 16th, 2006, 07:32 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

Sorry Karl, but I'm a little confused. I'm already using a sub query,
"qryTtlHrs", to calculate the denominator of the Percent expression.

-JZ

  #6  
Old May 16th, 2006, 09:21 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

Post your SQL statement - open query in design view, click on menu VIEW - SQL
View. Hightlight, copy, and paste in a post.

"JZ" wrote:

Sorry Karl, but I'm a little confused. I'm already using a sub query,
"qryTtlHrs", to calculate the denominator of the Percent expression.

-JZ


  #7  
Old May 16th, 2006, 09:27 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

SELECT DISTINCTROW ProjectList.[Primary Key],
MainProjectTable.ProjectID, ProjectList.AssignedEngineer,
Sum(MainProjectTable.HoursWorked) AS SumOfHoursWorked1,
qryTtlHrs.SumOfHoursWorked,
[SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked] AS [Percent]
FROM (qryTtlHrs INNER JOIN ProjectList ON qryTtlHrs.EmployeeName =
ProjectList.AssignedEngineer) INNER JOIN MainProjectTable ON
ProjectList.[Primary Key] = MainProjectTable.ProjectID
GROUP BY ProjectList.[Primary Key], MainProjectTable.ProjectID,
ProjectList.AssignedEngineer, qryTtlHrs.SumOfHoursWorked,
[SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked],
MainProjectTable.EmployeeName
HAVING (((MainProjectTable.EmployeeName)=[AssignedEngineer]));

-JZ

  #8  
Old May 16th, 2006, 11:05 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Why am I asked to enter parameter value?

I am not up to snuff on subqueries but I do see where [SumOfHoursWorked1]
comes from.
I would recommend you building a separate query if someone can not help with
the subquery.

"JZ" wrote:

SELECT DISTINCTROW ProjectList.[Primary Key],
MainProjectTable.ProjectID, ProjectList.AssignedEngineer,
Sum(MainProjectTable.HoursWorked) AS SumOfHoursWorked1,
qryTtlHrs.SumOfHoursWorked,
[SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked] AS [Percent]
FROM (qryTtlHrs INNER JOIN ProjectList ON qryTtlHrs.EmployeeName =
ProjectList.AssignedEngineer) INNER JOIN MainProjectTable ON
ProjectList.[Primary Key] = MainProjectTable.ProjectID
GROUP BY ProjectList.[Primary Key], MainProjectTable.ProjectID,
ProjectList.AssignedEngineer, qryTtlHrs.SumOfHoursWorked,
[SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked],
MainProjectTable.EmployeeName
HAVING (((MainProjectTable.EmployeeName)=[AssignedEngineer]));

-JZ


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Enter Parameter Value' dialog wrongly appearing in Access 2000 Darren Burns Setting Up & Running Reports 5 November 30th, 2005 12:52 PM
enter parameter value Question Running & Setting Up Queries 3 August 11th, 2005 09:58 PM
Enter parameter value John New Users 1 February 8th, 2005 02:22 AM
Unwanted enter parameter value TLuebke Setting Up & Running Reports 2 January 25th, 2005 05:09 PM
How do I print the details view David Running & Setting Up Queries 5 August 28th, 2004 12:17 AM


All times are GMT +1. The time now is 01:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.