Filter Date

Hi, I have a form which contains a listbox (holding the values Process
Date and Quantity) and I have a textbox which displayed the current
month. What I want to do is when I click on a command button
(cmdMonthDown) and the textbox value changes from May to April I want
the values in the listbox to be filtered so that only those values are
disiplayed that were entered in April.

If I'm not making sense please let me know otherwise your help would
be appreciated.

Thanks

0
Asif
5/15/2007 3:49:00 PM
access 16762 articles. 3 followers. Follow

3 Replies
766 Views

Similar Articles

[PageSpeed] 44

Reference the text box as a parameter in the list box's RowSourcee, e.g. if 
the text box shows the month name in full:

SELECT [Process Date], [Quantity]
FROM [YourTableOrQuery]
WHERE FORMAT([Process Date],"mmmm")
= Forms!YourForm!YourTextBox
ORDER BY [Process Date] DESC;

In the code behind your button add a line to requery the list box after the 
code which changes the value of the text box, e.g.

YourListBox.Requery

This will show dates from the same month in more than one year of course if 
the data covers several years.

Ken Sheridan
Stafford, England

"Asif" wrote:

> Hi, I have a form which contains a listbox (holding the values Process
> Date and Quantity) and I have a textbox which displayed the current
> month. What I want to do is when I click on a command button
> (cmdMonthDown) and the textbox value changes from May to April I want
> the values in the listbox to be filtered so that only those values are
> disiplayed that were entered in April.
> 
> If I'm not making sense please let me know otherwise your help would
> be appreciated.
> 
> Thanks
> 
> 

0
Utf
5/15/2007 5:19:00 PM
Thanks for your reply Ken, I've tried your suggestion but I'm not
getting the result I'm after. Hence what I've managed to do is in the
query behind the listbox I've added an expression in a new field

Expr1: Format([tbl_PROCESS.ProcessDate],"mmmm")

and as a criteria below that field I've added

[Enter Month]

Hence what happens now is when the form opens an input dialog box is
displayed asking for a month, and if I enter April for example then
all the records for April appear.

As mentioned in my previous post I already have a textbox in the form
displaying the current month, what I'm thinking is instead of
specifying the critera in the query how do I refer the critera to
whats the textbox in the form?


Thanks

0
Asif
5/16/2007 9:07:49 AM
How are you assigning the current month name to the text box when opening the 
form?  If you are doing this in code in, for instance, the form's Load event 
procedure, then requery the list box after assigning the value, e.g.

Me.YourTextBox = Format(VBA.Date,"mmmm")
Me.YourListBox.Requery

Referencing the text box as a parameter in the list box's RowSource in the 
way I described, requerying it again when you change the month, should work.

Ken Sheridan
Stafford, England

"Asif" wrote:

> Thanks for your reply Ken, I've tried your suggestion but I'm not
> getting the result I'm after. Hence what I've managed to do is in the
> query behind the listbox I've added an expression in a new field
> 
> Expr1: Format([tbl_PROCESS.ProcessDate],"mmmm")
> 
> and as a criteria below that field I've added
> 
> [Enter Month]
> 
> Hence what happens now is when the form opens an input dialog box is
> displayed asking for a month, and if I enter April for example then
> all the records for April appear.
> 
> As mentioned in my previous post I already have a textbox in the form
> displaying the current month, what I'm thinking is instead of
> specifying the critera in the query how do I refer the critera to
> whats the textbox in the form?
> 
> 
> Thanks
> 
> 

0
Utf
5/16/2007 9:38:03 AM
Reply:

Similar Artilces:

Name, Date and Address Formats
Hi, I have a number of different spreadsheets that I need to impirt into a single database. Unfortunately some of the information is in different formats. Would anyone be able to provide me with a solution that can turn: A B Brown ABC Brown *A B C*Brown* Brown, A B Brown, Anthony Bernard Brown Anthony Bernard Mr A B Bernard Into separate fields for title, forename, initials & surname On a similar theme I also need to do much the same thing with addresses: 1 Victoria Road, Victoria, Victoriashire, VC1 1VC etc And lastly (for now anyway) I also have some dates that I need to ...

Short / long date format bug?
The computer is set to use the long date format and everything is OK until I make changes to a chart which causes all dates in all open worksheets to be displayed in the short date format. When excel is closed down and restarted the problem is resolved - but doing this is annoying. I can't see if this a known fault or if it has been introduced through a patch. Does anyone know anything about this strange behaviour please? Thanks. Bill Ridgeway Since posting this I haven't had one response. I can't believe I'm the only user experiencing this problem. Every time I...

Compare this year/qtr/mo to date with prior year/qtr/mo to date
Hi, I'm trying to create a report that compares revenues received this year/qtr/mo/wk with revenues received last year in the comparable year/qtr/mo/wk, and additionally by sales division and sales manager. I have the data stored in a table with fields: SlsDivID, SlsMgrID, DtRecd and AmtRecd. I know I will need to use the date part function, but am not sure how to get the info in the report I need. format should be: SlsDiv - SlsMgr - CY YTD - LY YTD - G/L and % - CY QTD - LY QTD - G/L and % etc etc. I have tried pivot tables (not working) and various group and total functions (a...

Can Excel express a date with ordinals?
Wondering if excel can express mmm dd dates including their ordinal? Examples are: May 4th, October 1st, June 3rd. Thanks! Wendy Wendy, For a date in A1: =TEXT(A1,"mmmm ") & IF(DAY(A1)>0,DAY(A1)&IF(AND(DAY(A1)>10,DAY(A1)<20),"th",CHOOSE(MOD(DAY(A1),10)+1,"th","st","nd","rd","th","th","th","th","th","th")),"") HTH, Bernie MS Excel MVP "Wendy D" <WendyD@discussions.microsoft.com> wrote in message news:054E5E93-3B1B-4311-AB49...

excel filter
I wont to know if it�s possible to sort or filter by colo -- Message posted from http://www.ExcelForum.com The explanation is a bit long for here..........please check the site below, and if you have more questions, post back........ http://www.cpearson.com/excel/SortByColor.htm Vaya con Dios, Chuck, CABGx3 "shlomop >" <<shlomop.1820m6@excelforum-nospam.com> wrote in message news:shlomop.1820m6@excelforum-nospam.com... > I wont to know if it's possible to sort or filter by color > > > --- > Message posted from http://www.ExcelForum.com/ > ...

Excell & MailMerge dates
I have an excel file with dates broken down with a cell for the number in the month, a cell for the month, and a cell for the year. I used the "MMMM" for the month. In excell the cell reads "July", but when I use the cell as a data cell for mail merge in WORD I don't get the month I get the date number. Is there a way to get WORD to read the MONTH? Thanks From a previous post: You could use some helper cells and create strings for each field--then use those helper values: =text(a1,"dd-mmm-yyyy") =text(b1,"0.0") =text(c1,"#,##0.00&q...

Date Format turn to Year #2
From: learning_codes@hotmail.com - view profile Date: Thurs, Nov 16 2006 9:24 pm Email: "learning_co...@hotmail.com" <learning_co...@hotmail.com> Groups: microsoft.public.excel Not yet ratedRating: show options Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse | Find messages by this author Hi, I tried to convert the date to YEAR and then the year plus 25 Years later. =3DYear(A1) I'm getting the result 1900 instead of 1965. I tried to add 25 years later to 1990 from 1965. Your help would be much apprecated...

Input Mask for Dates
Can I apply an input mask or custom format to cells so that users do not have to type the slashes for date entry? Thanks! Hi have a look at http://www.cpearson.com/excel/DateTimeEntry.htm This requires VBA as this can't be done with formating only. -- Regards Frank Kabel Frankfurt, Germany Allison wrote: > Can I apply an input mask or custom format to cells so > that users do not have to type the slashes for date > entry? Thanks! You can use some VBA code that will interpret a date that is entered with out "-" or "/". See Chip Pearson's site: ...

USA to UK Dates
I have a list of data extracted from elsewhere and the dates are in USA format i.e. mm/dd/yyyy Can excel swap this around to UK format dd/mm/yyyy ? thanks in advance -- Vass ................................................ Now: YZF-R1, CBR1100xx-x Then: A100, MBX80, XL125, CB400, FZR600, CBR600Fv Hi, Format the dates to dd/mm/yyyy Highlight the dates Format > Cells > Number tab > Date > choose the one you need If it is not in there go to Custom and put dd/mm/yyyy in the space provided under Type. HTH. -- greg7468 -------------------------------------------------...

Use combo to print report between two sets of dates
I am trying to print a report that shows timesheet entries for two sets of dates. The report also prints out based on the data entry person selected. The user selects their name and then uses another combo box to select pre entered dates. My code is as follows: Private Sub cboDates_Click() Dim stDocName As String Dim FromDate As Date 'Name of criteria start timesheets date field. Dim ToDate As Date 'Name of criteria end timesheets date field. Dim FromOTDate As Date 'Name of criteria start OT date field. Dim ToOTDate As Date 'Name of criter...

Service Appointment, Activity History, and "Due Date"
When I create a service appointment in CRM, and I check the "All Day Event" check box, the schedule start and end times disappear, and the dates sync. This seems logical. However, when I look in the activity tab or the history tab the "Due Date" displays the next day. For example, I create a service appointment where the scheduled start date is 2/10/2007, and I select the "All Day Event" checkbox. The scheduled end date is set to 2/10/2007, the duration is set to 1 day, and the time fields disappear. If I view this service appointment in the activities ...

Table Filters and Empty Records
Hi, I'm quite new to Reporting Services and am having a bit of a confusing afternoon with it. I'm trying to build a report that contains a series of discrete reports for a number of projects that show project data and any milestone tasks associated with each project; if a project has no milesetones, the project data is still to be displayed. So, I build a report that has a series of fields showing project information (name, cost, state, etc.) and then a table below it to contain the milestone tasks for each project. All of these are placed within a list data region ...

Dates in Excel 2007 graph axis dialogs
I work for an environmental engineering firm, and commonly create time-series and other scatterplots of numerical data using Excel. In Excel 2003, I could format a time-series scatterplot axis minimum and maximum easily by typing in the dates in short date format. Not so in 2007 - it refuses to accept dates in anything but "days elapsed since 01/01/1900" format. Is there a workaround for this? Why was it changed? It was quite useful. Overall, I'm pretty unhappy with the new Excel. It seems to have acquired a lot more layers of very questionable usefulness. Many of...

Using Filter string with IF function
Is there a way to use a filter string with the IF function? I have a spreadsheet that looks like this: Invoice No. Invoice Date Invoice Currency Invoice Value 1 dd/mm/yyyy USD 1234.56 65 dd/mm/yyyy USD 2345.67 74 dd/mm/yyyy EUR 3456.78 88 dd/mm/yyyy USD 4567.89 when I filter on the currency: is there a function such as if(filter_string="USD";TRUE;FALSE)??? Thanks Aref Maybe this: Assuming row 1 are t...

chart with dates on the x-axe
how can you change the x-axe into a text x-as when the data are dates ? on specific dates a want to show a specific value. When I want to create e.g. a line-type chart, the values are ok, but the x-axe with the dates becomes a time-ax in stead of showing the real dates from the data. Is there a way to change the dates into text, without making it explicit text (with a ') because I want to use them also for calculating things. ??? -- chriske ------------------------------------------------------------------------ chriske's Profile: http://www.excelforum.com/member.php?action=getinf...

sender filtering on exchange 2003 server
i setup an exchange 2003 server to retreive it's e-mail from a provider's POP3 server for the time being due to the fact that the MX records haven't been changed yet. Now i enabled senderfiltering on my exchange server and it doesn't seem to work Question: Does this have anything to do with the pop3 mailbox of my provider or is there something else going on alltogether?? -- "Computers are useless, they can only give answers...." .. (Pablo Picasso) Obviously no one knows or nobody wants to help "Rik" wrote: > i setup an exchange 2003 server to re...

Date Entry in Excel 2000
Hi All, We recently upgraded to 2003 and one of our users says she was able to enter a date such as 10/24/04 in Excel 2000 as 102404 when she had the cell formatted as a date. I haven't been able to reproduce it on a 2000 machine nor does it make sense to me that it would work given that a date in Excel has a numeric value which is unrelated to the digits in the date. Is she mistaken or is there a setting I don't know about which allows this? Thanks Erin She's most probably mistaken. That behavior isn't native to XL. It's possible to do this with event macros...

filtered rows getting shaded alternately (conditional formatting)
Dear Experts: The following formula (=MOD(SUBTOTAL(3,$A$1:$A2),2) as a conditional format keeps up alternate shading even if a list is filtered Now I would like to use a macro solution to automate this process with the following requirements: - The List is in Sheet 1 and has the following name: 'Sheet 1! DataList' - The macro solution should allow for extension of the list below the named range, i.e. a dynamic named range is to be used in the macro - Alternate grey shading is to be applied Help is much appreciated. Thank you very much in advance. Regards, Andrea...

How do get the years and days Between two dates
if you had 5/1/2006 and 2/28/2002 how would you get 4.17? If 5/1/2006 is in A1 and 2/28/2002 is in A2, then maybe: =(a1-a2)/365 or =(a1-a2)/365.25 But if you're trying to find differences between dates, you may want to take a look at =datedif(). You can find lots of info at Chip Pearson's site: http://www.cpearson.com/excel/datedif.htm (=datedif() was only documented in xl2k's help.) jhon doe wrote: > > if you had 5/1/2006 and 2/28/2002 how would you get 4.17? -- Dave Peterson ...

Auto filter on blank lines
When I auto filter there is normally blank lines at the bottom but now when it's filtered it's greyed out and I can't add any new lines. ...

dates as minimum axis values
Excel versions prior to Excel 2007 allowed dates to be entered as minimum axis values for XY charts on the axis format scale menu. In Excel 2007 when I attempt to enter a date as a minimum value, i.e. attempting to enter 1-1-2007 with the Fixed radio button selected in Axis Options, the automatic value pops back up unchanged. I can successfuly enter a numeric value, but not a date. This requirement adds several extra steps - calculating a date value and typing the resulting number, then deleting the calculation - to what used to be a simple process. If anyone knows that the same cap...

Automaticaly put in the / in a date field
I want my users to input a date in the format dd/mm/yy I know some of them will mis out the separators and enter for example 140301 for the 14th March 2001, but Excel changes the date to something totally different. How can I create a mask (like in Access) so the separators are already displayed in the cell? For example the cell would look like / / and when the date is input it automatically jumps over the separator. You could use a worksheet event that changes the entry to a date. Chip Pearson has some code at: http://www.cpearson.com/excel/DateTimeEntry.htm Keith wrote: > ...

Extraction of Dates
Hello...I would appreciate any help. I have database that I am creating and one of the tables contains SessionId (unique), StartDate, and an EndDate. This data comes from a data logger. There is also another table connected to this table that records a sound code at night, and a date if sounds were heard (within those session dates). However...if there was no sound...then that date does not get input. What I would like to see is an output of all the dates (from the StartDate to the EndDate for each session), whether or not there was a sound or not. How do I generate a popul...

how do i create reminders in outlook from a date cell in excel?
I need to know how to create reminders in outlook from a date cell in excel? hi "Philhegele" Try posting in an Outllook forum. Maybe they will be more helpfull. Greetings from France Dav "Philhegele" <Philhegele@discussions.microsoft.com> a écrit dans le message de news:D31EF446-D6BA-45E7-A766-EC3400CF3B26@microsoft.com... >I need to know how to create reminders in outlook from a date cell in >excel? ...

How to add the date after the "A1"
Hi, I type "The information gathered as of March 9, 2008" on cell "A1" Is there a way to make a date default like "The information gathered as of " & Date (default). Your help would be much apprecated. ="The informations gathered as of "&TEXT(TODAY(),"mmmm d, yyyy") -- Kind regards, Niek Otten Microsoft MVP - Excel <learning_codes@hotmail.com> wrote in message news:c11a1bfc-65ba-4cf3-bdef-c28bdcc19c1d@8g2000hse.googlegroups.com... | Hi, | | I type "The information gathered as of March 9, 2008" on cell "A1&q...