I am trying to create a form to populate a table with the following fields:
|Resource |Project |Position |Week |Monday |Tuesday |Wednesday |Thursday |Friday|
It keeps track of daily goals that are specific to a Resource, position, and day.
The form is intended to be able to enter information as fast as possible so right now I have it set up with 4 comboboxes across the top:[Week][Resource][Project][Position] Then underneath that is a subform in datasheet format display these 4 fields as well as a field for each weekday.
My goal is to be able to sort the data in the subform using the comboboxes and then edit it within the subform. The Week combo box populates using a table listing monday dates and the following row source code:
SELECT Mondays.[Monday Dates]
FROM Mondays
WHERE (((Mondays.[Monday Dates])>(Date()-14) And (Mondays.[Monday Dates])`<(Date()+60)));`
What I want to do is have the subform with the data table automatically show records for every Week within the above range (-14days to +60 days), Resource, and Position with either nulls or zeros under each of the daily goal fields so that the user will be able to sort through records and edit them instead of creating a new record every time. I don't think this is something I can do by just creating all the records and putting them into the table because there are constantly going to be new Projects positions and resources. So I believe I need to accomplish this in my query but I am not sure. My query includes all the fields listed above. Currently its just filtering the records in the table by the resource combobox in my form. I need to figure out how to only filter it if there is a value in the box and then apply that to the other boxes. Not quite sure how to do this but it seems simple enough. The real question I have is how can I set this up so that there are records in that subform for each resource position and week within the range -14 days to +60 days?
Also on a side note: I am worried that the way I have my data table set up is going to cause me a lot of trouble down the road but I am not sure. I originally wanted to have a record for each date, but in the form they need to display in weeks and be able to be edited like that. So I guess what I'm asking is how bad is it to store one record for every week with a field for each day? And if it is something I really don't want to do, does anyone know of a better way to approach this.
Aucun commentaire:
Enregistrer un commentaire