davetough
asked on
adding a calculation on form
hello,
have attached database-
open database and a form comes up- click Item code and name button-
( enter 101 for item code and jim for name)
a Form comes up that displays avg time it takes Jim to work on item code 101-
question:
Is there a way to display also on this form? the total avg time it takes all names listed in the table?
Thank you,
DB101.accdb
have attached database-
open database and a form comes up- click Item code and name button-
( enter 101 for item code and jim for name)
a Form comes up that displays avg time it takes Jim to work on item code 101-
question:
Is there a way to display also on this form? the total avg time it takes all names listed in the table?
Thank you,
DB101.accdb
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the first answer worked fine and then I realized I did want to filter on item code-
am attaching error I am getting- can see what am doing wrong- have tried LM solution too and not working-
thank you
error.docx
am attaching error I am getting- can see what am doing wrong- have tried LM solution too and not working-
thank you
error.docx
ASKER
will post another question-thank you
sorry about the error. the Me keyword is valid in VBA, however in a Control Source expression, you use [Form]
=DAvg("[Time Spent]","Table1", [Item Code]='" & [Form]![Item Code] & "'')
or, you just drop the form reference since your scope is the current form ...
=DAvg("[Time Spent]","Table1", [Item Code]='" & [Item Code] & "'')
=DAvg("[Time Spent]","Table1", [Item Code]='" & [Form]![Item Code] & "'')
or, you just drop the form reference since your scope is the current form ...
=DAvg("[Time Spent]","Table1", [Item Code]='" & [Item Code] & "'')
ASKER
thanks - you know I am still getting error-
can you insert code into txtbox on form and attach db back here?
also just to confirm I am doing this right -am inserting code into the control source of the unbound textbox on form ( form2)
thanks
can you insert code into txtbox on form and attach db back here?
also just to confirm I am doing this right -am inserting code into the control source of the unbound textbox on form ( form2)
thanks
This ...
Should be this ...
Pay close attention to the quotes! It seems that LSM inadvertently did not balance the quotes and I copy pasted from him <dazed> ... So, I think I got it right this time! {note: I am not in a position to post a sample, so hopefully this will do the trick!
=DAvg("[Time Spent]","Table1", [Item Code]='" & [Form]![Item Code] & "'')
Should be this ...
=DAvg("[Time Spent]","Table1", "[Item Code]='" & [Form]![Item Code] & "'")
Pay close attention to the quotes! It seems that LSM inadvertently did not balance the quotes and I copy pasted from him <dazed> ... So, I think I got it right this time! {note: I am not in a position to post a sample, so hopefully this will do the trick!
=DAvg("[Time Spent]","Table1")