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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|