Results 1 to 3 of 3
  1. #1
    RunTime91 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2014
    Posts
    284

    Attempting to nest a formula inside an IIf statement in the Control Source of Textbox

    Greetings All...

    It's been a while since I created in access so please forgive if I'm asking the impossible...

    I'm trying to get the following the work in the Control Source Property of a TextBox placed in the Report Footer.

    =IIf(([SalePerson]) = "Rick", Avg([Sales]), Null)



    The formula doesn't error, but it returns 'Null', which actually is an error as the correct value should be 136.6

    What I'm trying to get to work is simply to have a textbox that shows the average sales for Rick.

    Can this be done using the Control Source property?

    Thanks Everyone...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    =Avg(IIf(SalePerson = "Rick", Sales, Null))
    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
    RunTime91 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2014
    Posts
    284
    So Glad You're still out there June ~

    As you already know... solution worked brilliantly!

    Thank You so much for your help!

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

Similar Threads

  1. Replies: 7
    Last Post: 05-12-2018, 01:13 PM
  2. Replies: 6
    Last Post: 03-07-2018, 06:05 AM
  3. IIF statement in control source propety of the textbox
    By AmanKaur123 in forum Programming
    Replies: 2
    Last Post: 03-09-2017, 04:30 AM
  4. Replies: 17
    Last Post: 02-08-2012, 10:06 AM
  5. Replies: 2
    Last Post: 07-30-2009, 08:02 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