Results 1 to 3 of 3
  1. #1
    Johin.b is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7

    Please explain this formula

    Hi guys,



    I am new to access db. In one of the db, I saw the following formula where there are three options available and only one can be chosen 1. By Branch 2. By Postal code 3. By Country

    IIf([chkBranch]=(-1),[cmbForBranch],IIf([chkPostalCode]=(-1),[cmbSelectCountry],IIf([chkCountry]=(-1),
    [List107])))

    Can someone please tell me in simple english what this formula actually does?

    Thanks in Advance!
    Regards,
    Joe

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If the chkBranch check box is selected, return the value from cmdForBranch,
    else if the chkPostal check box is selected, return the value from cmbSelectCounty
    else if the chkCountry check box is selected, return the value from List107.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    BTW, the formula is missing the FALSE option in the 3rd IIF() function

    IIf([chkBranch]=(-1),[cmbForBranch],IIf([chkPostalCode]=(-1),[cmbSelectCountry],IIf([chkCountry]=(-1),
    [List107], "Unselected")))


    If [chkBranch] is Unselected
    and [chkPostalCode] is Unselected
    and [chkCountry] is Unselected,
    return "Unselected" (or ???)

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

Similar Threads

  1. Can someone explain what this means?
    By Jay13 in forum Access
    Replies: 5
    Last Post: 05-23-2013, 04:22 PM
  2. Can someone explain querydef?
    By roguex20 in forum Access
    Replies: 2
    Last Post: 07-22-2012, 11:57 AM
  3. Explain iif in ms access
    By pabbiraj in forum Programming
    Replies: 2
    Last Post: 05-27-2012, 01:20 AM
  4. plz explain how to use iif in msaccess
    By pabbiraj in forum Access
    Replies: 2
    Last Post: 05-22-2012, 01:39 PM
  5. Can someone explain to me why this is not working
    By Darkladymelz in forum Programming
    Replies: 6
    Last Post: 03-19-2012, 05:55 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