Open form on a particular date record (1 Viewer)

yetstar

Registered User.
Local time
Today, 14:57
Joined
Aug 8, 2007
Messages
18
Hi all

I've trawled the posts and cant find anything relating to this, so would appreciate any help massively :)

I have a form which is used to show whether certain people are present on certain days, using a simple date/staff/tick box format. (See example)

I'm trying to have a form open at the latest date, but still show all of the other records.

What would the code be so the form opens at the current date? When I try and specify the date for it to open it always applies a filter....

Any ideas? :)
Thanks
 

Attachments

  • form.JPG
    form.JPG
    75.7 KB · Views: 98

missinglinq

AWF VIP
Local time
Today, 17:57
Joined
Jun 20, 2003
Messages
6,420
Assuming that the form is sorted by your date field (as it appears) and assuming the current date is the last date entered:

Code:
Private Sub Form_Load()
  DoCmd.GoToRecord , , acLast
End Sub
 

yetstar

Registered User.
Local time
Today, 14:57
Joined
Aug 8, 2007
Messages
18
Assuming that the form is sorted by your date field (as it appears) and assuming the current date is the last date entered:

Code:
Private Sub Form_Load()
  DoCmd.GoToRecord , , acLast
End Sub

Ah, well the form goes into the future as well, so the last date would be the last date in the table (which is about 2 years into the future!)

BUT I've just thought, if I limit the dates shown in the query that the form comes from to today()+7 or something, this should suffice.....we dont need to work out staff levels THAT far into the future really :D

Thanks for the help :)
 

Users who are viewing this thread

Top Bottom