In (x,y,z) question

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

In (x,y,z) question

Post by bknight »

I have a field that is date/Time format. For a given set of Days could be grouped by filling in the interior with the dates desired, but this is a manual operation. Is there a form which would allow a current week dates to be included, whatever the week may be just the current week?

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: In (x,y,z) question

Post by HansV »

You might create a rule of type Expression Is with formula

[DateField]>=Date()-Weekday(Date())+1 And [DateField]<Date()-WeekDay(Date())+8
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

In a criteria line?

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: In (x,y,z) question

Post by HansV »

I thought you wanted to create a conditional formatting rule.
If you want to return only records for the current week in a query, set the Criteria for the date/time field to

>=Date()-Weekday(Date())+1 And <Date()-WeekDay(Date())+8
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

Works for today, thanks.

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

Well, I spoke one day too soon.
Image of query that works displays 2 records 5/20 and 5/21. Second image is of form with query as recordset, this doesn't work. I get only one return record with #Name? for the first field. Any ideas?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: In (x,y,z) question

Post by HansV »

Impossible to tell without seeing the database
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

You always say that with a smile.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: In (x,y,z) question

Post by HansV »

This is what I see when I open the form:

S2551.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

I see that also when I re-opened. It did as I described, so why the change after closing and re-opening?

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: In (x,y,z) question

Post by HansV »

Perhaps the query had to be run again. Otherwise, I wouldn't know.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1463
Joined: 08 Jul 2016, 18:53

Re: In (x,y,z) question

Post by bknight »

I don't know either.