Results 1 to 7 of 7
  1. #1
    Holli is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    46

    Trying to use IIf(Is Not Null expression in control source

    Thanks for any direction. Trying to use =Iff(Is Not Null


    I have a =IIf in the control source of a textbox. It works great with IIf (IsNull
    Code:
    =IIf (IsNull ([Coding Errors]),IIf(IsNull([MM Changes after WF)],"Field Required","),"))
    .

    "Field Required" shows up in the textbox if the textboxes are empty I need "Field Required" if there is a value
    present.



    Thanks

    Holli

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You have written it so that "Fields Required" shows up only if both values you are checking for are Null (empty).
    If you want it to show up if a value is present for either field (or both), you could use:
    Code:
    =IIf((IsNull([Coding Errors])) And (IsNull([MM Changes after WF])),"","Field Required")
    If you want something else, please describe what you want in each situation (if none are null, one is null, both are null).

  3. #3
    Holli is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    46
    Thanks Joe,

    I have Is Not Null stuck in my head. Maybe I not thinking correctly.

    If there is a value in the textbox Error Coding and/or MM Changes after WF, then I would like the Note Text Box to read "Required Field". If no value the Note textbox should remove blank.

    Right now with the IsNull the Note TextBox reads "Required Field" when Error Coding and MM Changes after WF are empty.

    Thanks

    Holli

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I think you are still confusing us here. Let's break this down into each situation:

    - What should be returned if [Coding Errors] is Null and [MM Changes after WF] is Null?

    - What should be returned if [Coding Errors] is Not Null and [MM Changes after WF] is Null?

    - What should be returned if [Coding Errors] is Null and [MM Changes after WF] is Not Null?

    - What should be returned if [Coding Errors] is Not Null and [MM Changes after WF] is Not Null?

  5. #5
    Holli is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    46
    Sorry,

    Thank you for the format.

    What should be returned if [Coding Errors] is Null and [MM Changes after WF] is Null? Nothing Blank

    - What should be returned if [Coding Errors] is Not Null and [MM Changes after WF] is Null? Field Required

    - What should be returned if [Coding Errors] is Null and [MM Changes after WF] is Not Null? Field Required

    - What should be returned if [Coding Errors] is Not Null and [MM Changes after WF] is Not Null? Field Required

    Holli

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The formula I posted up in post #2 should do exactly that.
    Have you tried it?

  7. #7
    Holli is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    46
    Sorry for the daily.
    Thanks JoeM perfect.

    Holli

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

Similar Threads

  1. Control source Expression giving #Error
    By N3w2access in forum Forms
    Replies: 5
    Last Post: 01-21-2014, 07:53 AM
  2. Replies: 1
    Last Post: 08-13-2013, 10:06 AM
  3. Control Source is Null
    By CementCarver in forum Forms
    Replies: 8
    Last Post: 06-07-2013, 10:40 AM
  4. Replies: 3
    Last Post: 04-30-2013, 05:32 AM
  5. Textbox Control Source As An Expression help!
    By emilyrogers in forum Forms
    Replies: 11
    Last Post: 02-11-2011, 07:31 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