Continuous Form SQL

  • Thread starter ladybug via AccessMonster.com
  • 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!!!
 
J

John W. Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Looping An SQL Statement 6
Assistance with vbYesNo 3
Access VBA too slow and the WEEKDAY() function 8
week numbers 3
Run-time error 91... 2
Sundays 5
db.Execute Error 6
Form and Subform Events 2

Top