Results 1 to 3 of 3
  1. #1
    BEI77 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2014
    Location
    KY
    Posts
    24

    Why won't this formula work?

    I am a novice at Access. I am building a database to store and calculate vehicle A/C refrigerant test that will also diagnose the problem.

    Here are my fields and formulas,

    Ambient Temp
    Low Side Press
    High Side Press
    LSP1
    LSP1R



    LSP1 is a calculated field with this formula, =IIF([Ambient Temp]=65, IIF([Low Side Press]<25,"LOW","") &""& IIF([Low Side Press]>35,"HIGH","")))

    LSP1R is a calculated field that will give the result of the LSP1, =IIF([LSP1]=LOW,"Add Refrigerant","") &""& IIF([LSP1]=HIGH,"Needs Service",""))

    I get a syntax error when I go to save the db. All help is appreciated.

  2. #2
    Join Date
    Apr 2017
    Posts
    1,776
    Code:
    =IIF([Ambient Temp]=65, IIF([Low Side Press]<25,"LOW","") &""& IIF([Low Side Press]>35,"HIGH","")))
    Lets take this formula apart
    Code:
    =Iif(Condition1, TrueResponse1, FalseResponse1)
    Condition1 = [Ambient Temp]=65
    TrueResponse1 = IIF([Low Side Press]<25,"LOW","") &""& IIF([Low Side Press]>35,"HIGH","")
    
    TrueResponse1 = IIF(Condition11,TrueResponse11,FalseResponse11) & "" & IIF(Condition12,TrueResponse12,FalseResponse12)
    Condition11 = [Low Side Press]<25
    TrueResponse11 = "LOW"
    FalseResponse11 = ""
    
    Condition12 = [Low Side Press]>35
    TrueResponse12 = "HIGH"
    FalseResponse12 = ""
    
    FalseResponse1 = )
    How must Access calculate FalseResponse1! Especially when there is missing delimiter for FalseResponse1! Really you have formula
    Code:
    =Iif(Condition1, TrueResponse1))
    I leave analyze of 2nd formula to you!

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Advising against storing calculation in tables even if it did work. A form should return the decision/advice based on inputs of AmbientTemp, LSvalue and HSvalue as recorded. Acceptable HS and LS readings vary with ambient temp and gas type, correct? So are you intending to store every possible combination of acceptable high and low values for each given possible ambient temp and gas type? I should hope not. At most, you might store Pass/Fail given a TestID, but not in the same table as the diagnostic values. Note that I do not use spaces in my field name examples.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  3. Replies: 4
    Last Post: 12-06-2014, 08:49 PM
  4. Can't work on formula field query.
    By bubai in forum Access
    Replies: 11
    Last Post: 11-21-2014, 11:47 AM
  5. Please help with formula
    By JeanZander in forum Database Design
    Replies: 2
    Last Post: 01-07-2013, 04:39 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