Fill Text Boxes With Dates

J

John Cello

Posted this a while back. Probably should have given more details. I've tried
using javascript, but can't get it to work.

On an intranet, I'm trying to write a timecard application for a client
(FP2003, Access 2003, Server 2000). I'm trying to get to where a user selects
the week start date from a DRW dropdown against this query:
SELECT tblStartDate.StartingSunday
FROM tblStartDate
WHERE (((tblStartDate.StartingSunday) Between Now()-14 And Now()));

On the form, I need to have the days of the week filled in after the user
selects the starting date from the drop down. I'm thinking (probably very
wrongly) that my best bet to do this is to use another DRW with this query:
SELECT tblStartDate.StartingSunday, [StartingSunday]+1 AS Monday,
[StartingSunday]+2 AS Tuesday, [StartingSunday]+3 AS Wednesday,
[StartingSunday]+4 AS Thursday, [StartingSunday]+5 AS Friday,
[StartingSunday]+6 AS Saturday
FROM tblStartDate
WHERE (((tblStartDate.StartingSunday) Between Now()-14 And Now()));

But I can't get the form to use the date from the drop down as a criteria
for the second DRW.

Any advice would be greatly appreciated, as I've already exploded 3 stress
balls trying to figure this out, and my PC is destined for flying lessons in
the very near future.

Thanks
 
J

Jon Spivey

Maybe misunderstood this but it sounds like you're retreiving Sundays date
and then you want to fill in the rest of the days of the week - so if the
Sunday was 27 Feb you'd want to return Monday 28th Tuesday 1st etc. If so
you don't need a dropdown you can just use a for next loop, eg
<%
sunday = cdate("02/27/2005")
for i = 1 to 14
response.write weekdayname(weekday(sunday+i)) & " " & sunday + i & "<BR>"
next
%>
 

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

Top