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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having Form Open to Specific Date

Status
Not open for further replies.
Mar 9, 2007
48
US
I have a form that has a date field (Clinic Date). In this field users enter a date of a meeting held every Thursday. Records are created in the form that can have a date of next Thursday or a Thursday in December. I would like to have the user open the form and the first record that has a Clinic Date for the upcoming Thursday.

Confusing I know. Here's an example:

1st record - Clinic Date = 06/28/2007
2nd record - Clinic Date = 07/12/2007
3rd record - Clinic Date = 07/26/2007

Today's date = 07/06/2007

Form opens to record with clinic date 07/12/2007.

On the Forms properties I have in the Filter field: ((Clinic.[Clinic Date]<=Now()+6)) but it's opening to the first record created. Where is my flaw?

Thanks so much in advnace for your help.
 




Hi,

Well it's TRUE that 06/28/2007 <= <=Now()+6, is it not?

How about
[tt]
MAX(Clinic.[Clinic Date])<=Now()+6))
[/tt]


Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
And what about this ?
(Clinic.[Clinic Date]-Now()) Between 0 And 6

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
SkipVought, you're correct but thank you for understanding what I meant regardless of what I said.

PHV and SkipVought, thank you both for your suggestions but the form is still opening to the first record. But still no luck. Perhaps an On Load event?
 
Me.Filter = "(Clinic.[Clinic Date]-Now()) Between 0 And 6"
Me.FilterOn = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top