Newbies creativelifemedia Posted September 23, 2010 Newbies Posted September 23, 2010 Hi, First please accept my apologies if this has been asked before, but I can't seem to find an answer to my specific problem. Within my database if have a "Jobs" table and a "Tasks" table. When a user inputs a Task, they select a job name, and cost, and the task gets sorted by ID into a portal in the relevant Jobs record. What I'd like to be able to do, is to calculate the total cost of all tasks completed for a particular Job and display the result in a field on the Jobs layout. Is this possible? I have attached a erd of my tables. Hope this all makes sense, Best wishes and thanks
bcooney Posted September 23, 2010 Posted September 23, 2010 Create a calc field in Jobs, TotalCost = sum ( jobs_Task::Cost). "When a user inputs a Task, they select a job name" Hope that's not the case. They should be selecting a JobID! You can avoid the user needing to select a JobID if you create a new task from the Job Form. On Job Form layout Button: New Task Set $jobID; Jobs::pkJobID Go to Layout Task Form New Record Set Tasks::fkJobID; $jobID
Newbies creativelifemedia Posted September 23, 2010 Author Newbies Posted September 23, 2010 Thanks for the quick reply! The solution was obvious, sorry. I didn't realise that Filemaker would auto calculate records that had the correct ID. Yes, you're right, they select the Job ID. Actually I'm using the popup select script that you wrote to select the ID :-) I think I had a reason for not wanting to create new Task records directly from the Job layout, but I can't remember what it was now. I guess I can have both. Thanks Again!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now