Results 1 to 8 of 8
  1. #1
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246

    Run Time Errors

    Have Table & Qry in the following:

    PrimaryID
    Type
    Discription
    Qty
    UnitCost
    ExtCost
    NetWght
    TotalWght

    In the Table I put under expressions the following

    ExtCost Field: [Qty] * [UnitCost]


    TotalWght Field: [Qty] * [NetWght]

    Now I am getting this when creating the form:

    Run-time error '2147352567(80020009)
    you cant assign a value to this object

    Ok where am I going wrong when trying to caculate these fields? Do I change the event to say after update for these fields?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    are any of your values null

    if they are you likely have to assign a value to account for a null value, for instance:

    ExtCost Field: iif(isnull([qty]) or isnull([unitcost]), 0, [Qty] * [UnitCost])

  3. #3
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    ok here is now what i am getting...


    Click image for larger version. 

Name:	Error.jpg 
Views:	8 
Size:	34.9 KB 
ID:	11712
    Hope you can see it..

    TIA!

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    post the formula that is causing the problem in your query. You have an invalid reference to a query, table or form in there somewhere.

  5. #5
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    ExtCost Field: iif(isnull([qty]) or isnull([unitcost]), 0, [Qty] * [UnitCost])[/QUOTE]

    The same exact thing you posted...

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Is this issue related to https://www.accessforums.net/access/...ess-33614.html ?

    Simple arithmetic with null should result in null. If you want to show a 0 instead of null, another method is:

    Nz([Qty],0) * Nz([UnitCost],0)
    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.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Remove the calculation field and see if you still get the error. If you do the problem lies elsewhere. If you remove the calculation field and you do still get the error you can do a couple things. Post the entire SQL string or take out one field at a time until the error stops, then look at the field that was causing the problem and post what the contents of that are if you can't figure it out from there.

  8. #8
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    its been solved!! Yea!! Thanks!!

    Stephanie

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

Similar Threads

  1. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  2. Replies: 4
    Last Post: 10-07-2011, 10:58 AM
  3. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  4. SQL that errors in VB
    By Wayne311 in forum Programming
    Replies: 3
    Last Post: 02-14-2011, 10:17 PM
  5. Replies: 11
    Last Post: 03-16-2006, 12:28 PM

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