Results 1 to 4 of 4
  1. #1
    WDC is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    6

    Error 3071 - Expression typed incorrectly, or to complex

    I'm getting the error 3071 when selecting expressions containing such as < 10 or >10 in an unbound combo field in an unbound "criteria form" set to filter a field in a query that contains integers. When I open the query in Design view, remove the build from the Criteria that links that field in the query to the combo field on the form, and then type in the expression <10, or >10 as the Criteria for that field, it works fine. Also, if I type a value, without any expression such as < or > into the combo field on the form, the query filters successfully on that value. The 3071 error occurs only when I attempt to filter by way of the "criteria form".where the conditions of < or > are used in the expression.
    Here is the SQL from that query:



    SELECT STUDENT_DISCIPLINE_ANALYSIS.SCH, STUDENT_DISCIPLINE_ANALYSIS.STUDENT_ID, STUDENT_DISCIPLINE_ANALYSIS.GEN, STUDENT_DISCIPLINE_ANALYSIS.GRD, STUDENT_DISCIPLINE_ANALYSIS.H, STUDENT_DISCIPLINE_ANALYSIS.I, STUDENT_DISCIPLINE_ANALYSIS.A, STUDENT_DISCIPLINE_ANALYSIS.B, STUDENT_DISCIPLINE_ANALYSIS.P, STUDENT_DISCIPLINE_ANALYSIS.W, STUDENT_DISCIPLINE_ANALYSIS.PRIMRY_AREA, STUDENT_DISCIPLINE_ANALYSIS.ACTION_CD, STUDENT_DISCIPLINE_ANALYSIS.CountOfSTUDENT_ID, STUDENT_DISCIPLINE_ANALYSIS.SumOfAUXILIARY_CODE
    FROM STUDENT_DISCIPLINE_ANALYSIS
    WHERE (((STUDENT_DISCIPLINE_ANALYSIS.H)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_HISPANIC]) AND ((STUDENT_DISCIPLINE_ANALYSIS.I)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_INDIAN]) AND ((STUDENT_DISCIPLINE_ANALYSIS.A)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_ASIAN]) AND ((STUDENT_DISCIPLINE_ANALYSIS.B)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_BLACK]) AND ((STUDENT_DISCIPLINE_ANALYSIS.P)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_PACIFIC]) AND ((STUDENT_DISCIPLINE_ANALYSIS.W)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_WHITE]) AND ((STUDENT_DISCIPLINE_ANALYSIS.ACTION_CD)=[Forms]![DISCIPLINE_ANALYSIS]![Cmb_DISCIPLINE_ACTION]) AND ((STUDENT_DISCIPLINE_ANALYSIS.SumOfAUXILIARY_CODE) =[Forms]![DISCIPLINE_ANALYSIS]![Cmb_TOTAL_DAYS]));

    Thanks in advance

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you're getting the error because control referencing in SQL will only pull values inside of those controls. They cannot, in any way shape or form, be interpreted as a functional part of the SQL statement itself (in your scenario).

    pretty sure about that.

  3. #3
    WDC is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    6
    Thanks "ajetrumpet", and I was hoping to create a very "user friendly" way for other users to be able to filter the query, as these users will only want to see and print out the report that is bound to the query. Any suggestions are certainly welcome.

    Thanks,
    WDC

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    "filtering" can be done plenty of ways.

    how about putting a ctrl on a form and req'ing a value in it before pushing a button and running the report??

    "filtering" to me simply means that you're manipulating the equality portion of the criteria clause, which is NOT what you're doing now.

    "filtering", in a text context, does not mean manipulating the actual functionality of the statement.

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

Similar Threads

  1. Help with Error (3071)
    By ron3rbns in forum Access
    Replies: 1
    Last Post: 03-05-2011, 01:56 AM
  2. Need help with Error (3071)
    By ron3rbns in forum Queries
    Replies: 0
    Last Post: 03-03-2011, 10:35 AM
  3. error 3071 on OpenReport command
    By degras in forum Reports
    Replies: 5
    Last Post: 02-15-2011, 10:40 AM
  4. Microsoft Access Error 3071
    By Ev0luTioN in forum Access
    Replies: 1
    Last Post: 08-04-2010, 04:35 PM
  5. need help, expression is too complex?
    By ice673 in forum Queries
    Replies: 5
    Last Post: 02-15-2010, 09:03 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