Continuous Form SQL

  • Thread starter Thread starter ladybug via AccessMonster.com
  • Start date Start date
L

ladybug via AccessMonster.com

I have 7 subforms in one form. The seven subforms represent each day of the
week. Below are queries that control the subforms. I attached the first
three sql statements for these queries:

Sunday:
SELECT TimeSheetDetail.day, TimeSheetDetail.person, TimeSheetDetail.entry_id,
TimeSheetDetail.function, TimeSheetDetail.Task, TimeSheetDetail.Origin,
TimeSheetDetail.Client, TimeSheetDetail.Program, TimeSheetDetail.hours,
TimeSheetDetail.Lifecycle, Weekday([day]) AS dayofWeek
FROM TimeSheetDetail
WHERE (((TimeSheetDetail.day)=[Forms]![Timesheet]![headersunday]) AND (
(TimeSheetDetail.person)=[Forms]![Timesheet]![person]) AND ((Weekday([day]))
=1));

Monday:
SELECT TimeSheetDetail.day, TimeSheetDetail.person, TimeSheetDetail.entry_id,
TimeSheetDetail.function, TimeSheetDetail.Task, TimeSheetDetail.Origin,
TimeSheetDetail.Client, TimeSheetDetail.Program, TimeSheetDetail.hours,
TimeSheetDetail.Lifecycle, Weekday([day]) AS dayofWeek
FROM TimeSheetDetail
WHERE (((TimeSheetDetail.day)=[Forms]![Timesheet]![headermonday]) AND (
(TimeSheetDetail.person)=[Forms]![Timesheet]![person]) AND ((Weekday([day]))
=2));

Tueday:
SELECT TimeSheetDetail.day, TimeSheetDetail.person, TimeSheetDetail.entry_id,
TimeSheetDetail.function, TimeSheetDetail.Task, TimeSheetDetail.Origin,
TimeSheetDetail.Client, TimeSheetDetail.Program, TimeSheetDetail.hours,
TimeSheetDetail.Lifecycle, Weekday([day]) AS dayofWeek
FROM TimeSheetDetail
WHERE (((TimeSheetDetail.day)=[Forms]![Timesheet]![headertuesday]) AND (
(TimeSheetDetail.person)=[Forms]![Timesheet]![person]) AND ((Weekday([day]))
=3));

The problem that I am having is that these subforms are Continuous Forms.
One you put one entry in on any given date any entries after the first entry
are being saved as Sundays date.

Can anyone give me some assistance. I did not create this so as much
direction in how to fix this would be greatly appreciated!!!
 
I have 7 subforms in one form. The seven subforms represent each day of the
week. Below are queries that control the subforms. I attached the first
three sql statements for these queries:

One way I did something similar (42 subforms for a calendar form) was to
instead have matching textboxes on the form. The first textbox has the
starting date of the week; each subsequent textbox has a control source

=DateAdd("d", 1, [FirstDayOfWeek])

for the second, adding 2, 3, ... 6 for the remaining ones.

These textboxes can be used as the Master Link Field linked to a date field
for the child link field for each subform.

John W. Vinson [MVP]
 
Back
Top