Results 1 to 5 of 5
  1. #1
    eagle1468 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2013
    Posts
    9

    Exclamation Trying to create a Report using 2 comboboxes with Month and Year

    I'm having a problem creating a report using 2 ComboBox -- One For Month and One For Year.



    Basically I have Created a Query that shows the Data I want in the Report. Based the Report off the Query. But I need a Form with only 2 ComboBox to make the Query filter the dates by Month and Year.

    The Dates in the Query Field "MoveInDate" is formatted mmm/dd/yyyy.

    What Criteria would I put in the Query and Where in the query would I put it to pull only those records that the Month and Year match the "MoveInDate"?

    I have tried -- [Forms]![ReportSelection]![ReportMonth] And [Forms]![ReportSelection]![ReportYear] in the Criteria under [DetailsQ].[MoveInDate] -- but it just errors out. I put "Like" in front of this Criteria -- No Error But the report shown No Records.....

    By the way the ComboBoxes pull from Tables to get their Value.
    I have 2 Tables for them. One is "ReportMonthT" with Fields:
    "ReportMonthID" = 1-12 & "ReportMonth" = January, February, etc. with the Respective MonthID.
    Then I have Table "ReportYear" with Just Years = 2012, 2013, 2014, etc.

    Please Help!!!!

    Thank you!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Try:

    WHERE Format([MoveInDate], "yyyymm") = [Forms]![ReportSelection]![ReportYear] & [Forms]![ReportSelection]![ReportMonth]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    eagle1468 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2013
    Posts
    9
    Quote Originally Posted by June7 View Post
    Try:

    WHERE Format([MoveInDate], "yyyymm") = [Forms]![ReportSelection]![ReportYear] & [Forms]![ReportSelection]![ReportMonth]

    I'm Getting an Error -
    The expression you entered contains invalid syntax
    You may have entered an operand without an operator

    Not sure whats wrong with it!?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Post the complete SQL statement for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    eagle1468 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2013
    Posts
    9
    Quote Originally Posted by June7 View Post
    Post the complete SQL statement for analysis.
    I got it! I just had to mess with it. All I had to do was pay attention where I was pulling MoveInDate from -- I for some reason didn't have it set to the right Query.

    Thank you VERY VERY Much! you have been a GREAT Help!!!!

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

Similar Threads

  1. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  2. Month and Day only not Year to create query
    By ssalem in forum Queries
    Replies: 3
    Last Post: 02-28-2013, 02:37 PM
  3. Sum by Won Project in by each month of the year
    By 011billyw in forum Reports
    Replies: 11
    Last Post: 03-22-2012, 04:09 PM
  4. Query / report per month and year
    By ripper in forum Queries
    Replies: 2
    Last Post: 10-24-2011, 07:51 AM
  5. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 PM

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