Results 1 to 3 of 3
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Help with if function in a field's control source

    I was hoping to come up with a an IF statement for the below situation but I'm struggling on how to write it.

    In [field 2]'s control source, I wanted the following:

    If [field1] > 10, then 'yes'
    If [field1] < 10, then 'no'


    If [field1] is null, then null

    Any suggestions? Multiple IF statements?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    The function is IIf(). Look it up. Consider Switch() or Choose().

    =Switch([field1]>10, "yes", [field1]<10, "no", True, Null)

    What should happen for exactly 10?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    That worked!!
    Thanks so much

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

Similar Threads

  1. Replies: 3
    Last Post: 03-11-2021, 01:30 PM
  2. Replies: 5
    Last Post: 01-20-2018, 03:40 PM
  3. Replies: 12
    Last Post: 01-15-2016, 09:42 AM
  4. Replies: 2
    Last Post: 05-28-2015, 12:12 PM
  5. My field is not found in Control Source List
    By eemiller1997 in forum Access
    Replies: 6
    Last Post: 10-25-2012, 01:49 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