(Msg. 1) Posted: Sat Aug 22, 2009 10:05 pm
Post subject: Date filter Archived from groups: microsoft>public>access>gettingstarted (more info?)
Hello,
I've gone through various articles and posts to try to figure this out...with
no success. I am using Access 2007.
Okay. I have a form, with the requisite unbound text boxes for Begin Date
and End Date (BeginDate and EndDate). What I obviously want to do is filter
my records based on those 2 controls. Here's where I am unclear. I have
read about the WHERE query and the sFilter Code. Do I do both or one or
should I just write a macro filter, which is something I have not done at all?
(Msg. 2) Posted: Sat Aug 22, 2009 10:05 pm
Post subject: RE: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
If your form is based on a query then use something like this in the criteria:
Between [Forms]![Schedule]![BeginDate] And [Forms]![Schedule]![EndDate]
it will filter between the two dates.
"Chris75" wrote:
> Hello,
>
> I've gone through various articles and posts to try to figure this out...with
> no success. I am using Access 2007.
>
> Okay. I have a form, with the requisite unbound text boxes for Begin Date
> and End Date (BeginDate and EndDate). What I obviously want to do is filter
> my records based on those 2 controls. Here's where I am unclear. I have
> read about the WHERE query and the sFilter Code. Do I do both or one or
> should I just write a macro filter, which is something I have not done at all?
>
>
> My form is called Schedule.
>
> Thanks for your help.
>
> Chris
>
>
(Msg. 3) Posted: Sat Aug 22, 2009 11:05 pm
Post subject: RE: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hi Richard,
The form is based on a table.
Richard wrote:
>If your form is based on a query then use something like this in the criteria:
>
>Between [Forms]![Schedule]![BeginDate] And [Forms]![Schedule]![EndDate]
>
>it will filter between the two dates.
>
>> Hello,
>>
>[quoted text clipped - 12 lines]
>>
>> Chris
(Msg. 4) Posted: Sun Aug 23, 2009 2:00 pm
Post subject: Re: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Base your form on a query, instead of a table. The query should look like:
"Chris75" <u54211@uwe> wrote in message news:9b00b5bee3c34@uwe...
> Hello,
>
> I've gone through various articles and posts to try to figure this
> out...with
> no success. I am using Access 2007.
>
> Okay. I have a form, with the requisite unbound text boxes for Begin Date
> and End Date (BeginDate and EndDate). What I obviously want to do is
> filter
> my records based on those 2 controls. Here's where I am unclear. I have
> read about the WHERE query and the sFilter Code. Do I do both or one or
> should I just write a macro filter, which is something I have not done at
> all?
>
>
> My form is called Schedule.
>
> Thanks for your help.
>
> Chris
>
(Msg. 5) Posted: Sun Aug 23, 2009 4:05 pm
Post subject: Re: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hi Arvin,
If I based the form on a query instead of the table, would my form not become
read-only? I want to be able to enter schedules as well.
Thanks.
Arvin Meyer [MVP] wrote:
>Sorry, that was wrong, it will prompt a second time. Instead use:
>
>Select * from tblSchedule Where DateField Between Forms!Schedule![BeginDate]
>And Forms!Schedule![EndDate];
>
>and make sure you change the names of the table and date field to match
>yours.
>> Base your form on a query, instead of a table. The query should look like:
>>
>[quoted text clipped - 20 lines]
>>>
>>> Chris
(Msg. 6) Posted: Sun Aug 23, 2009 5:05 pm
Post subject: Re: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
And remember that the fields BeginDate and EndDate are unbound and therefore
not part of my original table.
Chris75 wrote:
>Hi Arvin,
>
>If I based the form on a query instead of the table, would my form not become
>read-only? I want to be able to enter schedules as well.
>
>Thanks.
>
>>Sorry, that was wrong, it will prompt a second time. Instead use:
>>
>[quoted text clipped - 8 lines]
>>>>
>>>> Chris
(Msg. 7) Posted: Sun Aug 23, 2009 5:05 pm
Post subject: Re: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
No forms do not become read-only just because they are based on a query.
As long as you update records in the query, you can update records
displayed on a form using that query.
And you apply the criteria against your date field.
I am not clear on whether or not you have a button or other method to
initiate a requery based on your entries in the two unbound controls.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
Chris75 via AccessMonster.com wrote:
> And remember that the fields BeginDate and EndDate are unbound and therefore
> not part of my original table.
>
> Chris75 wrote:
>> Hi Arvin,
>>
>> If I based the form on a query instead of the table, would my form not become
>> read-only? I want to be able to enter schedules as well.
>>
>> Thanks.
>>
>>> Sorry, that was wrong, it will prompt a second time. Instead use:
>>>
>> [quoted text clipped - 8 lines]
>>>>> Chris
>
(Msg. 8) Posted: Sun Aug 23, 2009 5:05 pm
Post subject: Re: Date filter [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Sun, 23 Aug 2009 20:12:33 GMT, "Chris75 via AccessMonster.com" <u54211@uwe>
wrote:
>And remember that the fields BeginDate and EndDate are unbound and therefore
>not part of my original table.
>
>Chris75 wrote:
>>Hi Arvin,
>>
>>If I based the form on a query instead of the table, would my form not become
>>read-only? I want to be able to enter schedules as well.
>>
MOST forms are based on queries, and most queries are updateable. If you're
assuming that a query is ipso facto non-updateable you're missing a lot of the
power of Access!
Some queries - those for which Access cannot reliably tell which record to
update, such as Totals queries, UNION queries, complex multitable queries -
aren't updateable but a simple single-table query with a criterion or a sort
will be. And Arvin's suggested criteria are *from the form*, not from the
table.
--
All times are: Eastern Time (US & Canada) (change) Goto page 1, 2, 3, 4
Page 1 of 4
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum