John Vinson said:
Which of my two suggested approaches were you using - linking by
ClientID or linking by the two fields?
Ans: I tried both without success.
ClientID and that the Notes table should not contain the ClientCaseID
or TwoFields.
Ans. ok
Ans. Should be *ClientCaseID#* that is assisgned to each record. Duplicates -Yes_ because of the neccessity of adding a second child
....???
And this is what I don't understand. YOu "run a qry" - what query?
Could you post the SQL of the query that's not working? or do you mean
you're running a search on your Form?
Ans. I ran the query from Notes Form whose Property is Notes Table.
SQL: SELECT NotesTable.[Notes Text], NotesTable.[NotesID#],
NotesTable.[ClientCaseID#], NotesTable.TwoFiles
FROM NotesTable;
You say "the Notes ID that should be different from one another are not" - example?
Ans. I misspoke. The *NotesID#* does change with each entry of a record in the subform, BUT is duplicated in the record with the TwoFields. *NotesID#* is the primary auto number w/out duplicates of the Notes Table.
Well... since I don't know *specifically* what you tried, then I have
no way to know what you did wrong.
Let's go back to basics: this will be repeating some stuff.
What is (now) the Primary Key of Cases? Ans: ClientID
What is the Relationship between Cases and Notes?
Ans. Cases and Notes are jointed in my *qryNotesTableAll*: Notes Table and
Main Client Query joined by CaseClientID#. "only include rows where the
joined field from both tables are equal".
Sql:SELECT [Main Query Clients].ClientID, NotesTable.[NotesID#],
NotesTable.[Notes Text], NotesTable.[ClientCaseID#], [Main Query
Clients].[LastName Father], [Main Query Clients].[FirstName Father], [Main
Query Clients].[FirstName Mother], [Main Query Clients].[Case Handler], [Main
Query Clients].[Case Handler2], [Main Query Clients].[Case Opened or Closed]
FROM NotesTable INNER JOIN [Main Query Clients] ON
NotesTable.[ClientCaseID#] = [Main Query Clients].[ClientCaseID#]
WHERE ((([Main Query Clients].[Case Handler])=[Enter Your Last Name]) AND
(([Main Query Clients].[Case Opened or Closed])="yes"));
Which field or fields in Cases is linked to which field or fields in Notes?
Ans. ClientCaseID#
What is the Recordsource of the main form (if it's something other
than just the Cases table, please post the SQL).
Ans. It is the Main Client Query
SELECT Clients.[NotesID#], Clients.ClientID, Clients.[ClientCaseID#],
Clients.Code_No, Clients.Schcode, Clients.SchDisCon, Clients.SchoolCode,
Clients.CodeDefFirm, Clients.Defcslid, Clients.PrefixFather,
Clients.[FirstName Father], Clients.[LastName Father], Clients.PrefixMother,
Clients.[FirstName Mother], Clients.[LastName Mother], Clients.[Child First
Name], Clients.[Child Last Name], Clients.Address, Clients.Address1,
Clients.City, Clients.State, Clients.PostalCode, Clients.Email, Clients.[Home
Phone], Clients.WorkPhone, Clients.WorkExtension, Clients.WPhone,
Clients.WPhone1, Clients.WorkPhone2, Clients.WorkPhone3, Clients.MobilePhone,
Clients.CellPhone, Clients.FaxNumber, Clients.EmailName, Clients.ReferredBy,
Clients.[Type of Case], Clients.[Date Opened], Clients.[Date Closed],
Clients.[Case Handler], Clients.[Case Handler2], Clients.[Case Opened or
Closed], Clients.[File Out], Clients.Notes, Clients.Notes1,
Clients.RequestedRecords1, Clients.RequestedRecords, Clients.RecRecords,
Clients.[Recd Records1], Clients.[File Reviewed], Clients.RetainerLetter,
Clients.[Amount Retainer], Clients.[Amount Recevied], Clients.[Amount Used],
Clients.RequestHearing, Clients.HearingDate, Clients.RequestMed,
Clients.MedDate, Clients.Advisory, Clients.[PPT Date], Clients.SettleAgrmt,
Clients.SettleAgrmt1, Clients.SettleReached, Clients.Settlefunds,
Clients.Settlefunds1, Clients.RetainerRcdDate, Clients.Twofiles,
Clients.PrintFlag, Clients.Pulled, Clients.AttendMed, Clients.Advisory,
Clients.TimeMed, Clients.AttendDPH, Clients.TimeDPH, Clients.AttendPPT,
Clients.TimePPT, Clients.Probono, Clients.[Closed Letter], Clients.[Hours
Billed], Clients.[Amount Received], [School District].*, [District
Contacts].*, Schools.*, [Defense Firm].*, [Defense Attorney].*, Status.*,
Clients.RecRecords
FROM Status RIGHT JOIN ([Defense Firm] RIGHT JOIN ([Defense Attorney] RIGHT
JOIN (((Clients LEFT JOIN [District Contacts] ON Clients.SchDisCon =
[District Contacts].SchDisCon) LEFT JOIN [School District] ON Clients.Schcode
= [School District].Schcode) LEFT JOIN Schools ON Clients.SchoolCode =
Schools.SchoolCode) ON [Defense Attorney].Defcslid = Clients.Defcslid) ON
[Defense Firm].CodeDefFirm = Clients.CodeDefFirm) ON Status.Code_No =
Clients.Code_No;
What is the Recordsource of the subform (if it's something other than
just the Notes table, please post the SQL).
Ans. SELECT NotesTable.[Notes Text], NotesTable.[NotesID#],
NotesTable.[ClientCaseID#], NotesTable.TwoFiles
FROM NotesTable;