[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

avg calc on microsoft form

Posted on 2013-01-31
3
Medium Priority
?
364 Views
Last Modified: 2013-01-31
Hello
attached database-
open database- form opens
click button- enter [101] for item code and [jim] for name.
A form displays- I want to code the unbound textbox-
Have tried =DAvg("[Time Spent]","Table1", [Item Code]='" & Me![Item Code] & "'')
( receive error "expression you entered has invalid string")

the avg time spent displays the avg time jim ( or anybody you select) spent-
I want the total avg time spent- to display average time for everbody- on the item code selected

thank you-
DB201.accdb
0
Comment
Question by:davetough
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Expert Comment

by:Dale Fye
ID: 38840407
I cannot open your database (corporate policy).

Are you certain the [Item_Code] field in your table is  a string, and not numeric?  If numeric,
try:

 =DAvg("[Time Spent]","Table1", [Item Code]=" & Me![Item Code])
0
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 38840480
Couple of things...
You can't use 'me' in a controlsource expression.  It has to be the full form reference.
Some of your quotes were awry.

=DAvg("[Time Spent]","Table1","[Item Code]='" & [Forms]![form2]![Item Code] & "'")
0
 

Author Closing Comment

by:davetough
ID: 38840519
thank you
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question