Drop down list of Thursdays

B

Ben Webber

Hi,

I'm trying to create a drop-down list of dates (Thursday's only) ... limited
to this week's Thursday and last week's Thursday ... Has anyone done such a
thing, and would you be willing to share your code/technique?

Thanks in advance,
 
T

Tom Wickerath

Hi Ben,

You could populate your dropdown with this code:

Dim ThisWeekThur as Date
Dim LastWeekThur as Date

ThisWeekThur = Date - (Weekday(Date) - 5)
LastWeekThur = ThisWeekThur - 7



Tom
________________________________________

:

Hi,

I'm trying to create a drop-down list of dates (Thursday's only) ... limited
to this week's Thursday and last week's Thursday ... Has anyone done such a
thing, and would you be willing to share your code/technique?

Thanks in advance,
 
G

Graham R Seach

Ben,

Add this to the combo's RowSource:

SELECT Date()-(6-Weekday(Date(),7)) AS aThursday
FROM MSysObjects
WHERE (((MSysObjects.Name)='Forms'))
UNION
SELECT Date()-(6-Weekday(Date(),7))-7 AS aThursday
FROM MSysObjects
WHERE (((MSysObjects.Name)='Forms'))
ORDER BY AThursday

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Top