P
Paul Fenton
We have a query using 3 tables, tClients, tAppointments, and
tClientImprovements. tClients is basic client information, name,
address, date of sale, etc. tAppointments, is all the appointments
for the particular client and tImprovement is the home improvement
that the client is getting. The tables are linked by a unique ID,
tClients being one-to-many to each of the other tables.
This is the SQL:
SELECT DISTINCT tClients.*
FROM (tClients INNER JOIN tAppointments ON tClients.ID =
tAppointments.ID) INNER JOIN tClientImprovements ON tClients.ID =
tClientImprovements.ID
WHERE
(((tClientImprovements.Improvement)=[forms]![frmGetDatesImprovement]![cboImprovement])
AND ((tAppointments.Date) Between
[forms]![frmGetDatesImprovement]![txtStart] And
[forms]![frmGetDatesImprovement]![txtEnd]))
ORDER BY tClients.LName;
We use a form to enter a date range and a single improvement and get
all the records for every client who had an appointment in the date
range for that particular improvement.
This is the code that runs after updating the improvement field:
DoCmd.OpenForm "Browse Client List"
Forms![Browse Client List].RecordSource =_
"qBrowseByImprovementDates"
Forms![Browse Client List].Caption = "Viewing Appointments for " &_
Forms!frmGetDatesImprovement.cboImprovement & " between " &_
Forms!frmGetDatesImprovement.txtStart & " and " &_
Forms!frmGetDatesImprovement.txtEnd
We get all the right records, but can't update anything. What do I
have to change so that we can update the client records?
Paul Fenton
tClientImprovements. tClients is basic client information, name,
address, date of sale, etc. tAppointments, is all the appointments
for the particular client and tImprovement is the home improvement
that the client is getting. The tables are linked by a unique ID,
tClients being one-to-many to each of the other tables.
This is the SQL:
SELECT DISTINCT tClients.*
FROM (tClients INNER JOIN tAppointments ON tClients.ID =
tAppointments.ID) INNER JOIN tClientImprovements ON tClients.ID =
tClientImprovements.ID
WHERE
(((tClientImprovements.Improvement)=[forms]![frmGetDatesImprovement]![cboImprovement])
AND ((tAppointments.Date) Between
[forms]![frmGetDatesImprovement]![txtStart] And
[forms]![frmGetDatesImprovement]![txtEnd]))
ORDER BY tClients.LName;
We use a form to enter a date range and a single improvement and get
all the records for every client who had an appointment in the date
range for that particular improvement.
This is the code that runs after updating the improvement field:
DoCmd.OpenForm "Browse Client List"
Forms![Browse Client List].RecordSource =_
"qBrowseByImprovementDates"
Forms![Browse Client List].Caption = "Viewing Appointments for " &_
Forms!frmGetDatesImprovement.cboImprovement & " between " &_
Forms!frmGetDatesImprovement.txtStart & " and " &_
Forms!frmGetDatesImprovement.txtEnd
We get all the right records, but can't update anything. What do I
have to change so that we can update the client records?
Paul Fenton