Results 1 to 6 of 6

Err

  1. #1
    Rhubie is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    85

    Err


    Field in query - no error

    on form field (which is not enterable, just displayed - if it is neither Transfer Rolls or N - it gives #Err instead of null value

    TransferRollPrice: (Int(IIf([Classification]="Transfer Rolls",[USDollar]+[RetailMargin],IIf([Classification] ="Transfer Rolls" AND Mid([WBCode],4,1="N"),([USDollar]+[WBShipping])+[RetailMargin],Null))/0.05)*0.05)+0.0

    There should be no value in the form field if it is neither - not sure what I am doing wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    You are putting this calc in textbox ControlSource? If it works in query, just do it in query and bind textbox to the field name.

    Misplaced paren:
    (Int(IIf([Classification]="Transfer Rolls",[USDollar]+[RetailMargin],IIf([Classification]="Transfer Rolls" AND Mid([WBCode],4,1)="N",([USDollar]+[WBShipping])+[RetailMargin],Null))/0.05)*0.05)+0.0

    However, if Classification = "Transfer Rolls, the "N" condition will never take effect. Try:

    Int(IIf([Classification]="Transfer Rolls",([USDollar]+[RetailMargin]+IIf(Mid([WBCode],4,1)="N",[WBShipping],0))/0.05,Null)*0.05
    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
    Rhubie is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    85
    I have it in a query - I chose the field from the query? Not sure why I get this - do I need to rebind the field if I changed the query?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    If the constructed field name is not changed, then the binding is not changed.

    I was editing my previous post while you replied. Review again.
    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.

  5. #5
    Rhubie is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    85
    I am only getting the #ERROR when I leave it blank -

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    When you leave what blank - Classification?

    My suggested expression should handle that.

    If you want to provide db for analysis, follow instructions at bottom of my post. Identify the objects involved in this issue.
    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.

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

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