Link to home
Start Free TrialLog in
Avatar of getwidth28
getwidth28Flag for United States of America

asked on

How to get log totals in the tree view , another log database question

Thank you all for your continued help on this.  I am learning a ton and get stuck at about every step of the way but I am getting closer to having a code base that I can work from by copying and pasting.  

The project tree footage is working.  I was able to get a nested loop of the calculation working.

User generated image
I know how to do the SQL now for what I need to do, but I can't see how to do it in one of these fields.  I need to show the individual log footage for each tree.

User generated image
For example after selecting that first log and clicking on "View Logs" you get this screen and the total for that tree.

User generated image
If I go to the design view of the Tree Form and go to actions for the text field "txtCurrentLogFootage" it brings up the expression editor.  How do I do an SQL VBA query thing in there?
Database1683--2-.accdb
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of getwidth28

ASKER

Shucks, I tried to explain as well as I can.  I will try what you put probably this afternoon when I can.  If I need to I will explain better.   Thank you

I wasn't hinting at needing to store the calculations in the table, I changed my thoughts on that from this board (may have been you telling me).  I just know it would be easy to put the field in the txt box vs. a SQL Query.

Man that line is a mouth full.  How do you guys keep that stuff straight.
--->> How do you guys keep that stuff straight.

It is actually 95% what you had already written.  I just wrapped it in a function and added criteria.

The domain functions (DSum, DAvg, DLookup, etc)  are a very common way to 'query' single values to display in textboxes.

Jim Dettman has a great article detailing their usage here:
https://www.experts-exchange.com/Microsoft/Development/MS_Access/A_12-Dlookup-and-the-Domain-Functions.html
I plugged that in exactly how you wrote it and it worked right away.  Brilliant.  Thank you