Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Wrong # Arguments Error (2002)

    Hi,

    I'm using the following SQL in a query to produce a result if two areas on a form are null.

    =IIf(IsNull([Forms]![frmReports]![cmbEmployee]) AND (IsNull([Forms]![frmReports]![cmboFFICE],"ALL INCLUSIVE RECORD SUMMARY"))

    I get an error that there is a wrong # of arguments in the function. Is there a way to use two null expressions or what did I miss in the code?

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wrong # Arguments Error (2002)

    This is VBA, not SQL, so you can't use it in a query, but the way you have written it has left off the true and false arguments. I think you have misplaced your parens and that this is what you meant:

    <code>=IIf(IsNull([Forms]![frmReports]![cmbEmployee]) AND IsNull([Forms]![frmReports]![cmboFFICE]),"ALL INCLUSIVE RECORD SUMMARY", "")</code>

    .
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Wrong # Arguments Error (2002)

    Thanks Charlotte! That worked perfectly.
    Have a great day,
    Leesha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •