I'm not sure I'm going about this the right way, but here's the gist of what I'm working on:
I'm trying to track a certain activity (let's say number of calls made, although that's not the actual activity I'm tracking) and progress toward a goal related to that activity. Tracking the activity itself was easy enough to figure out (I've got a table with dates and times for starting and stopping and the amount of the activity completed in that time frame - i.e. number of calls made in that time), but figuring out how to compare against a goal has been more challenging.
I've got my database set up so that the user can select one of several different types of goals: having a goal of a certain number of calls made per day, or a certain amount of time spent making calls each day with the option of using the same daily call goal for every day of the week or to have a different goal for each day of the week. I store which mechanism the user has selected in a separate settings table.
The way I've been working this, I've got a table with fields for the Day of the Week (with a separate table listing 8 possible days: Monday through Sunday plus the eighth representing a daily constant), and two fields for the goal for that day: one that's the activity goal (number of calls made) and one that's the time goal (amount of time spent making calls), with the relevant field being used determined (in theory) by the selection saved in the settings table.
Right now I'm trying to design a form (or forms) for the user to enter the actual goals. My thought process was that I'd have a different form based on which goal setting the user had selected, and when the user goes to enter the goals the appropriate form is opened.
Where I'm having trouble is on the form for having a different goal for each day of the week, I wanted to have separate entry fields for each day of the week on one form, so that when a user enters a value in the form field for "Monday", the value is stored in the Goals table in a record where the Day is set to Monday and the Activity Goal field is the value the user entered, and the value entered into Tuesday is stored in a field where the Day is set to Tuesday, and so on. I recognize that initially these will all be null values because upon first entering the goals there are not yet separate records in the Goal table for each day of the week.
So far, when I've tried binding the form fields to the Activity Goal field in the table, entering a value into one means the same value is duplicated in all the other form fields, all linked to a single record.
So my question is: is there a way to do this? Or given what I've outlined I'm trying to do, is there a better way to achieve what I'm trying to accomplish? Frankly, I'm just stumped.
I'm trying to track a certain activity (let's say number of calls made, although that's not the actual activity I'm tracking) and progress toward a goal related to that activity. Tracking the activity itself was easy enough to figure out (I've got a table with dates and times for starting and stopping and the amount of the activity completed in that time frame - i.e. number of calls made in that time), but figuring out how to compare against a goal has been more challenging.
I've got my database set up so that the user can select one of several different types of goals: having a goal of a certain number of calls made per day, or a certain amount of time spent making calls each day with the option of using the same daily call goal for every day of the week or to have a different goal for each day of the week. I store which mechanism the user has selected in a separate settings table.
The way I've been working this, I've got a table with fields for the Day of the Week (with a separate table listing 8 possible days: Monday through Sunday plus the eighth representing a daily constant), and two fields for the goal for that day: one that's the activity goal (number of calls made) and one that's the time goal (amount of time spent making calls), with the relevant field being used determined (in theory) by the selection saved in the settings table.
Right now I'm trying to design a form (or forms) for the user to enter the actual goals. My thought process was that I'd have a different form based on which goal setting the user had selected, and when the user goes to enter the goals the appropriate form is opened.
Where I'm having trouble is on the form for having a different goal for each day of the week, I wanted to have separate entry fields for each day of the week on one form, so that when a user enters a value in the form field for "Monday", the value is stored in the Goals table in a record where the Day is set to Monday and the Activity Goal field is the value the user entered, and the value entered into Tuesday is stored in a field where the Day is set to Tuesday, and so on. I recognize that initially these will all be null values because upon first entering the goals there are not yet separate records in the Goal table for each day of the week.
So far, when I've tried binding the form fields to the Activity Goal field in the table, entering a value into one means the same value is duplicated in all the other form fields, all linked to a single record.
So my question is: is there a way to do this? Or given what I've outlined I'm trying to do, is there a better way to achieve what I'm trying to accomplish? Frankly, I'm just stumped.