A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filtering on Data Range



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2006, 04:19 PM posted to microsoft.public.access.forms
Katie
external usenet poster
 
Posts: 256
Default Filtering on Data Range

I am trying to set up a form that allows a user to select the records they
want to view by date range. I want the user to be able to enter the starting
date and ending date and then view only those records in that date range.

I used the [enter start date] [enter end date] option but it's not querying
my records.

What am I doing wrong?

Thank you.

  #2  
Old November 6th, 2006, 04:55 PM posted to microsoft.public.access.forms
kingston via AccessMonster.com
external usenet poster
 
Posts: 620
Default Filtering on Data Range

If you're using the built in menu option Records - Filter - Filter By Form,
the user will need to use the words Between ... And ... If you are designing
your own query based on two text box entries, validate the entries to make
sure that the dates are real and then in your query use something like:

Between [Forms]![MyFormName]![StartDate] And [Forms]![MyFormName]![EndDate]

If you're using a parameter query, use something like this as the criteria
for your date field:

Between [StartDate] And [EndDate]

However, you will run into problems if the user enters an erroneous date or
set of dates. So you may want to try and trap bad dates with IIF() functions.


Katie wrote:
I am trying to set up a form that allows a user to select the records they
want to view by date range. I want the user to be able to enter the starting
date and ending date and then view only those records in that date range.

I used the [enter start date] [enter end date] option but it's not querying
my records.

What am I doing wrong?

Thank you.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200611/1

  #3  
Old November 13th, 2006, 01:53 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default Filtering on Data Range

What I have for my database is a query which lists distinct dates (not
multiple copies). Use the query as the source for two combo boxes. List all
the dates for the first combo box and, for the 2nd combo box, only list those
dates that come after the start date (cascading combo).

SELECT [dateID].[WeekID] FROM dateID WHERE
(([dateID].[WeekID][forms].[report options].[txtdatefrm]));

"report options" is the name of the form and "txtdatefrm" is the name of the
first combo box

By doing this, you are guaranteed to use the correct dates.

Hope this helps!

"Katie" wrote:

I am trying to set up a form that allows a user to select the records they
want to view by date range. I want the user to be able to enter the starting
date and ending date and then view only those records in that date range.

I used the [enter start date] [enter end date] option but it's not querying
my records.

What am I doing wrong?

Thank you.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.