Results 1 to 6 of 6
  1. #1
    TracyBell is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    23

    Parameter query error


    I'm trying to create what seems like a simple parameter query and I keep getting an error stating,
    "The expression is typed incorrect, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
    (Attached is a screen shot after clicking on "help" with this error.) I have checked and double checked that I am entering the parameter per instructions in Access and can't figure out what's going on.

    When I remove the parameter and just put "Yes" in the criteria the query works fine. Also works fine with no criteria.

    Please help! Thanks in advance.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Without seeing the SQL of the query, it is hard to make any suggestions.

    Would you post the SQL of the query?

  3. #3
    TracyBell is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    23
    Thanks for the response. OK, I realize my database isn't normalized and I'm working on a new version to fix that - but I'm not sure that should affect this anyway. Here's the SQL:

    SELECT tblOwner.OwnerID, tblOwner.OCompanyName, tblOwner.OFirstName1, tblOwner.OLastName1, tblOwner.OFirstName2, tblOwner.OLastName2, tblOwner.OAddress, tblOwner.OCity, tblOwner.OState, tblOwner.OZip, tblOwner.OOfficePhone, tblOwner.OHomePhone, tblOwner.OMobilePhone, tblOwner.OEmail, tblOwner.Bank_FiduciaryName, tblOwner.Bank_FiduciaryAccount, tblOwner.Current, tblOwner.PMAgreementStart, tblOwner.PMAgreementEnd, tblOwner.OTaxID_SSN, tblOwner.ContingencyReserve, tblOwner.[LeasingFee%], tblOwner.[ManagementFee%], tblOwner.[M&RExpenseThreshold], tblOwner.SDAccountMaint, tblOwner.DebtSvc_Taxes_Insurance, tblOwner.EquityCheck, tblOwner.EquityBank_FiduciaryName, tblOwner.EquityBank_FiduciaryAccount, tblOwner.MoSummary_Statement, tblOwner.EndDate, tblOwner.MoSummary_SendTo
    FROM tblOwner
    WHERE (((tblOwner.Current)=[Enter YES for current:]));

  4. #4
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think you are getting the error because you have a reserved word ("Current") as a field name. And it is not very descriptive... maybe use "AcctIsCurrent".

    Try adding brackets around the field name in the WHERE clause of the SQL:

    Code:
    WHERE (((tblOwner.[Current])=[Enter YES for current:]));
    Here is a link to a list of reserved words in Access and SQL:

    http://allenbrowne.com/AppIssueBadWord.html


    Also, you shouldn't use special characters in object names (ex !@#$%^&*() ) . Only use letters, numbers and the underscore ( _ ).

  5. #5
    TracyBell is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    23
    Thanks for the info.
    I changed the field name to "CurrentAcct" (also updated other fields which had symbols) and then changed the WHERE clause to:
    WHERE (((tblOwner.[CurrentAcct])=[Enter YES for current:]));
    but I'm still getting the same error. Any other ideas?

  6. #6
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I created a table with your fieldnames and then created the query. I didn't have any data, but when the query executed, I didn't have any errors either.

    The only thing I can suggest is to delete the query, do a Compile and repair, close the database, open it and recreate the query.

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

Similar Threads

  1. How to run parameter query from VBA
    By John Southern in forum Programming
    Replies: 10
    Last Post: 02-07-2014, 02:24 PM
  2. Replies: 2
    Last Post: 04-18-2011, 06:12 AM
  3. Subforms and Query Parameter
    By luminairesolutions in forum Forms
    Replies: 2
    Last Post: 01-27-2011, 09:43 AM
  4. Parameter query
    By doss13 in forum Queries
    Replies: 1
    Last Post: 06-26-2010, 06:11 AM
  5. Parameter Query help...
    By daggy in forum Queries
    Replies: 1
    Last Post: 05-11-2010, 01:10 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