I have a main form for this db and a tabbed control with 7 subforms, one for each day of the week, on the main form. The subforms are built from a query in order to get some calculation fields to show. I have the calculated fields showing on the main form using the DLookup function. The subforms are linked to the main page with [ClientID]=[WeekID].
I need to be able to add a new record to the subform(s) without copying the record for the main form and be able to display the DLookup values based on each additional Weekly Activities record inserted.
This morning it occurred to me that I need to add another keyfield, CaseID and set up the following relationships: CaseID->ClientID, One-to-One; CaseID->WeekID, One to Many (One CaseID for many WeekIDs). Otherwise, I am linking the Weekly Activities information to the Client Information and if you want to add a new record to the Weekly Avticities, the Cleint Information (name, address, etc.) will also be copied. This is obviously bad design. However, I can’t get the CaseID to do anything: I can define a table called CaseID with one field, autonumbered, with the relationships designed as specified and it doesn’t change when I do stuff to the main form. Any advice on how to setup the db structure? Again, I need to tie the weekly activities info to a client but a single client may have more than one week entered. If i implement the standard wizard-based Add a Record to the main table, both records get copied and a new, blank Week Activities record displays. Close but no cigar.
So my questions are: How does one set up PK/FK structures to group multiple weekly activities to a particular client and, How do I add a new Weekly Activities record to the subform/query.
Also, since the subforms are based on a single query, it would seem to me that one could add a record to the query or underlying table and have each of the subforms show that new record or goto it using GotoRecords,,acLast
Once I get this problem solved I need to start generating reports and the main report is ClientName + WeeklyActivities by Month (date range). Then this project is looking complete!
TIA