Results 1 to 8 of 8
  1. #1
    BluEydRdr2014 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Sep 2014
    Posts
    3

    Need Help with Conditional Expressions

    I am trying to create a conditional expression in a table.

    I am trying to say the following:
    If [KIND] is "DEER", return "70", Otherwise, if [KIND] is "ELK", return a calculation that is [WEIGHT]*.7.

    I am hung up on the calculation for the "ELK." If I write IIF([KIND]="DEER","70", IIF([KIND]="ELK", "[WEIGHT]*.7","OTHER")). I can enter the expression, but when I open my Form and select "ELK", the field that is supposed to have the calculation just shows [WEIGHT]*.7.....it does not perform the calculation.

    What am I doing wrong?

    Thanks for the help.



    Crystal

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    IIF([KIND]="ELK", "[WEIGHT]*.7",

    What happens, if you remove the double quotes

    IIF([KIND]="ELK", [WEIGHT]*.7,

    Thanks

  3. #3
    BluEydRdr2014 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Sep 2014
    Posts
    3
    It said my result type, such as binary or NULL, is not supported by this server.

    I tried to make it simple and just do one True/Falsse, so I wrote: IIf([KIND]="DEER","70",[WEIGHT]*.7).

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Does your [KIND] field have null or no values in one or more records ?

    Thanks

  5. #5
    BluEydRdr2014 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Sep 2014
    Posts
    3
    Hmmm...no it is not. However, it is a drop down list made from another table. I wonder if that is the problem?

  6. #6
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    usually the experts advise us to avoid dropdown lists in tables. But feel that is not the problem.
    Edit : Assume even the Weight Field has values in all its records.
    Thanks

  7. #7
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Check what happens if you use below :

    IIF([KIND]="DEER","70", IIF([KIND]="ELK", Nz([WEIGHT],0)*.7,"OTHER"))

    Thanks

  8. #8
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    requery the control that is supposed to show the results after update of cbo

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

Similar Threads

  1. Conditional Query with conditional results
    By Jeff_in_KCMO in forum Queries
    Replies: 4
    Last Post: 09-10-2014, 01:44 PM
  2. If Then Expressions?
    By FoxMan250 in forum Access
    Replies: 34
    Last Post: 05-08-2014, 12:30 PM
  3. Delimiter expressions
    By kjcochran in forum Queries
    Replies: 3
    Last Post: 06-16-2013, 06:45 AM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. Expressions in Form
    By Deb4566 in forum Access
    Replies: 7
    Last Post: 03-08-2013, 12:18 PM

Tags for this Thread

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