How to fix "The expression you entered contains invalid syntax"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Hayes
    New Member
    • Jan 2011
    • 3

    #1

    How to fix "The expression you entered contains invalid syntax"

    I am trying to convert this excel expression into an Access expression:

    =IF(OR(B79="",B 62="", H7=""),"Require d Fields Incomplete",IF( AND(F87<20000,O R(J87>P14, B87>P37)),"Yes, this is a HIGH COST loan. Proceed to Step 5 Excluded Fees Test.",IF(AND(F 87>=20000,J87>P 12),"Yes, this is a HIGH COST loan.","No, this is NOT a High Cost loan")))

    I've converted the cell numbers to field names, however I am unable to overcome the error message: "The expression you entered contains invalid syntax. you may have entred a comma without a preceding value or identifier.

    This is what I have entered into ACCESS:

    =IIf([Amount financed]=" " Or [Tot fees]=" " Or [Loantype]=" ","Required Fields Incomplete",0,i if(AND([division]<20000, OR [High Cost Determination]>.08 OR [Division]>1000, "YES, this is a HIGH COST loan Proceed to Step 5 Excluded Fees Test",0, iif ([Division]>=20000, AND [High Cost Determination]>.04,"Yes, this is a High Cost Loan","No, this is NOT a High Cost loan" )))

    Please assist and thanks

    Steve
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    You are supplying 4 arguments in your first IIF statement, and the IIF statement only takes 3 arguments.

    If your trying to validate the data entry there are much better ways of doing this, such as the Form's BeforeUpdate event. If you try to explain what your needs are, Im sure me or someone else can offer some competent advice.

    Comment

    Working...