I believe I misunderstand your design. Could you post a picture of the table relationships?
Is an office be on more than one route, or not? (I assume not)
Can an employee be in more than one office, or not? (I assume not)
Based on my assumptions, I cobbled together this theoretical set of tables:
Code:
tblRoute
RouteID Primary Key, autonumber
RouteName text
tblOffice
OfficeID Primary Key, autonumber
OfficeName text
OfficeAddress text
RouteID Foreign key to tblRoute
tblEmpl
EmplID Primary Key, autonumber
EmplName text
OfficeID Foreign key to tblOffice
tblEmplNotes
NoteID Primary Key, autonumber
EmplID Foreign key to tblEmployee
NoteDate Date/time
Notes memo
tblVisit
VisitID Primary Key, autonumber
OfficeID Foreign key to tblOffice
VisitDate Date/time
VisitComplete yes/no
VisitNotes Text
The query for all employee notes on a Route would look something like
Code:
SELECT
tblRoute.RouteName,
tblRoute.RouteID,
tblOffice.OfficeID,
tblOffice.OfficeName,
tblEmpl.EmplID,
tblEmpl.EmplName,
tblNotes.NoteID,
tblNotes.NoteDate,
tblNotes.Notes
FROM
(tblNotes INNER JOIN tblEmpl ON tblNotes.EmplID = tblEmpl.EmplID)
INNER JOIN
(tblRoute INNER JOIN tblOffice ON tblRoute.RouteID = tblOffice.RouteID)
ON tblEmpl.OfficeID = tblOffice.OfficeID
ORDER BY tblRoute.RouteName, tblOffice.OfficeID, tblEmpl.EmplID, tblNotes.NoteDate
;
That will give you all notes for each employee on each route. Call that query for example qry_AllEmplNotesonRoutes.
You could put a WHERE RouteName = "Today's Route Name" in there and you'd be able to use it to print your route report. You might need to add a "route order" field to the office record.
Here's a query that returns just the keys for the latest note for each employee. This is aircode, typed quickly, but it would be something like this.
Code:
SELECT NoteID FROM tblEmplNotes As TEN1
WHERE NoteDate =
(SELECT MAX(NoteDate)
FROM tblEmplNotes As TEN2
WHERE TEN1.EmplID = TEN2.EmplID);
Call that query qry_LastNote.
Something like this would get you only the latest note for each employee on today's route:
Code:
SELECT QEN* FROM qry_AllEmplNotesonRoutes AS QEN
WHERE (QEN.NoteID IN qry_LastNote)
AND QEN.RouteName = "Today's Route Name";
That's just a real kneejerk code up there, I'm sure it will need tweaked, but it should approximate your need.