Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Form-Date?

Status
Not open for further replies.
Mar 29, 2002
33
US
I've created a form with two text boxes. One is for start date, the other is for the end date. The Text boxes are attached respectively to fields that currently hold start and end dates for the each week from now until 2004. As the cursor arrow at the bottom of the form is pushed it goes onto the next record and the next sequential week. As the year goes on I would like to avoid tabbing through the record cursor to the current week. My question is as follows: Can code be added to Access forms to allow the record to be pulled as the form is opened based off of the current date. I know it's possible in VB6, as I’ve used it in a time reporting database for work. If further information is needed please post questions and I’ll reply ASAP.
Thank you-
 
I would like this forms date span closets to the current date to be present when the form is opened.
Thank you-
 
I have just tested this, & you can do what I think you are trying to achieve by creating a query, which will act as the recordsource for the form...

SQL:
SELECT Sheet1.StartDate, Sheet1.EndDate, Sheet1.ID
FROM Sheet1
WHERE (((Sheet1.StartDate)<Date()) AND ((Sheet1.EndDate)>Date()));


I tried this & with a form with its recordsource set to the above SQL statement, only opened the record where the current date lies between [StartDate] & [EndDate]...

James Goodman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top