Results 1 to 2 of 2
  1. #1
    brew is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    16

    Continuous Form and a Combo Box Filter

    Hi,



    I don't suppose I could ask what is probably a rather basic question, either way it has me stumped.

    I have a continuous form with the following fields

    Case No -- Completion Date -- Cost 1 -- Cost 2 -- and a few more

    The field I'm interested in filtering the form by is the 'Completion Date' field.

    I would like to have two combo boxes, one to filter by month and another to filter by year.

    My first problem is how to populate the combo boxes based on the data that's available, the month combo box can quite happily have and the months of the year, but the year combo box should only show available years since I don't think it's ideal to have to pick from every year past, present and future.

    Then there's the matter of filtering the data.

    Thanks in advance for any help

  2. #2
    brew is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    16
    Right, I think I may of made a little progress but i'm having some trouble wrapping the various parts up with a nice bow.

    Correct me if I'm wrong.....

    I have two Combo boxes;

    [CboMonth]

    Row Source: "January";01;"February";02;"March";03;"April";04;" May";05;"June";06;"July";07;"August";08;"September ";09;"October";10;"November";11;"December";12

    Bound Column: 2
    ----------------------------------

    [CboYear]

    Not too sure how to go about the year combo box, is there a way of populating the combo box with available years or am i stuck with manually entering years as with [CboMonth].
    ---------------------------------

    As for running the filter i believe i can use this

    Code:
    Private Sub CboMonth_AfterUpdate()
    Me.Filter = "Month(CompletionDate)=" & Me.CboMonth & "AND Year(CompletionDate)=" & Me.CboYear
    
    Private Sub CboYear_AfterUpdate()
    Me.Filter = "Month(CompletionDate)=" & Me.CboMonth & "AND Year(CompletionDate)=" & Me.CboYear
    End Sub
    ---------------------------------

    I think I have all the parts right but as my Access knowledge isn't great I'm having trouble bringing everything together, if someone wouldn't mind helping me stick these fragment together id be very grateful.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Filter a Continuous Form
    By michel_annie22 in forum Forms
    Replies: 7
    Last Post: 11-09-2011, 07:34 AM
  2. Cascading Combo box in Continuous Form
    By neo651 in forum Access
    Replies: 1
    Last Post: 09-15-2011, 02:34 AM
  3. Replies: 1
    Last Post: 07-30-2011, 03:21 PM
  4. Replies: 2
    Last Post: 04-12-2011, 08:33 PM
  5. Continuous Subforms Filter Dependant Combo
    By BigBear in forum Forms
    Replies: 0
    Last Post: 04-19-2009, 08:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums