WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Date filter

 
Goto page 1, 2, 3, 4
   Home -> Office other -> Getting Started RSS
Next:  I need some help: Command button code that filter..  
Author Message
Chris75

External


Since: Aug 23, 2009
Posts: 2



(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?


My form is called Schedule.

Thanks for your help.

Chris
Back to top
Login to vote
Richard

External


Since: Apr 26, 2006
Posts: 166



(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
>
>
Back to top
Login to vote
Chris75

External


Since: Aug 23, 2009
Posts: 2



(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
Back to top
Login to vote
Arvin Meyer [MVP]

External


Since: Oct 02, 2008
Posts: 405



(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:

Select * from tblSchedule Where DateField Between Forms!Schedule![Enter
BeginDate] And Forms!Schedule![Enter EndDate];
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"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
>
Back to top
Login to vote
Chris75 via AccessMonster

External


Since: Aug 23, 2009
Posts: 16



(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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200908/1
Back to top
Login to vote
Chris75 via AccessMonster

External


Since: Aug 23, 2009
Posts: 16



(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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200908/1
Back to top
Login to vote
John Spencer

External


Since: Jan 21, 2007
Posts: 428



(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
>
Back to top
Login to vote
John W. Vinson

External


Since: Jan 29, 2004
Posts: 4627



(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.
--

John W. Vinson [MVP]
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Getting Started 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
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support