Results 1 to 2 of 2
  1. #1
    jacek.w.bak is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Posts
    3

    Post IIf(IsError ... problem ...

    Hello,

    On a form I have few txt boxes which give values for user as info

    texbox1:


    =DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID])

    testbox2
    =IIf(IsError([textbox1])=True;"No Records";IIf(([textbox1]) Is Null;"No Records";[textbox1]))

    on error in textbox1, textbox2 returns "No Records"
    on Null in textbox1, textbox2 returns returns "No Records"

    If I combine the two to have just one text box it doesn't work
    ex:
    =IIf(IsError([DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID])])=True;"No Records";IIf((DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID])) Is Null;"No Records";DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID])))

    any clues what is wrong?

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It looks like you had a couple of extra brackets. Try this:

    Code:
    =IIf(IsError(DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID]))=True;"No Records";IIf(IsNull(DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID]));"No Records";DSum("[Amount]";"[tbl_Main]";"[ID]=" & [txtbox_ID])))

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  2. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM

Tags for this Thread

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