I am sorry if this has been answered before or if it seems like an overly simple question, but I have been searching for hours for an answer to this. I need to display either a form or report, I don't really care which, that will have a text box that will display the average (or minimum/maximum) for a given field inside of a table. However I do not want all the records just the ones the meet my criteria I have tried the following and nothing seems to work.
1 text box with DAvg
Code:
=DAvg("Field1",[Table],[Table]![Field2]=[Forms]![InputBox1]![Combobox1])
This gives me an #name? error.
2 I have tried doing an SQL query and have the control source point to that and I can get all sorts of errors here depending on how I go about it.
my exact SQL code as of now
Code:
SELECT AVG(Archive.Moist_AR) AS Moist_Avg
FROM Archive
WHERE (((Archive.Sample_Location)=Forms!InputBox_Stats_Moisture!Location) AND((Archive.Customer_Name)=Forms!InputBox_Stats_Moisture!Customer));
I do not want to list any of the records just the averages of them.
I have googled my brains out and have no idea what is going on with it, Please help me!