Hi Everyone,

I am struggling with getting an average from tbl_Something.Specific_columns (=numbers) to display the results within a textbox when the form is loaded, my form already retrieves other data based on other boxs and comboboxs etc, which I don't want to interfere with.

So I attempted to insert the following into the control of a textbox
=avg(((Workers.OT_Hours)>0) AND ((Workers.workLocation)="Texas"))
But access is having trouble with evaluating the above formula and gives an error
Can anyone help me on achieving the result I wish.

I built a query using the wizard and it works just fine as below:

SELECT Avg([OT_hours]) AS AverageOT_Hours
FROM workers
WHERE (((workers.OT_Hours)>0) AND ((Workers.workLocation)="Texas"));
any help appreciated!