Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2016
    Posts
    5

    Creating a filter to a report using a date - Error message - This expression is typed incorrectly.

    Hi Guys,



    Looking for some help please.

    My DB has a table that records results based on a user created "Week Ending"

    So for example on of my tables has these fields

    [Task Name] [Week Ending] [Percentage Complete] [Estimated Duration]

    I Created a query to pull this information out of the table. I created a report based on this query, then added a form with a combo box and a button.

    The combo box is controlled by the week ending field and on click the button opens the report.

    In the criteria of the query is : [Forms]![frm_Reports]![Combo13]

    The idea being the user selects which week ending they want, and the report shows the current [Percentage complete] for each [Task Name].

    Unfortunately when i click the button i get quite a long error message - "This expression is typed incorrectly, or it is too complex to be evaluated......."

    Can anyone tell me why i'm getting this error message please? I have managed to filter the report via other means but not on the "Week Ending" field & that's the main one i need.

    Here is the SQL for the query
    SELECT tbl_Projects.[Project Name], tbl_TasksTracker.WeekEnding, tbl_Tasks.[Task Name], tbl_TasksTracker.PercentageComplete
    FROM (tbl_Projects INNER JOIN tbl_Tasks ON tbl_Projects.[Project Number] = tbl_Tasks.Project) INNER JOIN tbl_TasksTracker ON tbl_Tasks.ID = tbl_TasksTracker.TaskID
    WHERE (((tbl_TasksTracker.WeekEnding)=[Forms]![frm_Reports]![Combo13]));


    Thanks in advance.

    Liam

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try:
    Code:
    SELECT tbl_Projects.[Project Name], tbl_TasksTracker.WeekEnding, tbl_Tasks.[Task Name], tbl_TasksTracker.PercentageComplete
    FROM (tbl_Projects INNER JOIN tbl_Tasks ON tbl_Projects.[Project Number] = tbl_Tasks.Project) INNER JOIN tbl_TasksTracker ON tbl_Tasks.ID = tbl_TasksTracker.TaskID
    WHERE (((tbl_TasksTracker.WeekEnding)=#" & [Forms]![frm_Reports]![Combo13] & "#"));
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Join Date
    Jan 2016
    Posts
    5
    Hi Bob,

    Thanks but when i try and paste that into the sql is tells me there is a syntax error on the last line?

    Thanks

    Liam

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    When you tested this, was the form frm_Reports open?
    Did you paste this into the SQL view of the query wizard?

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

Similar Threads

  1. Replies: 5
    Last Post: 10-19-2015, 04:22 PM
  2. Replies: 5
    Last Post: 07-30-2014, 03:55 PM
  3. Replies: 2
    Last Post: 05-25-2013, 09:16 PM
  4. Replies: 1
    Last Post: 05-24-2012, 12:34 PM
  5. Replies: 3
    Last Post: 03-31-2011, 11:07 AM

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