Results 1 to 3 of 3
  1. #1
    jker is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    36

    acess 2007 - how to handle nulll values

    I have text box(InvB4Tax) with an expresion of l1cost+l2Cost+L3cost. my problem is that any of those values can be null.

    How can i test each value for null. If it is null replace with a numeric zero

    <------ this is my expression to calculate value of INVB4Tax



    <------ this is my text box that will contain the sum of l1cost+l2cost+l3cost

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Use the nz function to substitute 0 for null

    Nz(l1cost,0) + nz(l2Cost,0)+etc

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    i shortened it to NZZ so i dont have to add the dang zero,( esp in queries), then its: NZZ(l2Cost)

    paste into module:
    Code:
    Public Function Nzz(ByVal pvAmt)
    On Error Resume Next
        Nzz = Nz(pvAmt, 0)
    End Function

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

Similar Threads

  1. Acess 2007 - New Record problem
    By st21 in forum Access
    Replies: 30
    Last Post: 11-16-2021, 03:17 AM
  2. Conversion from Acess 2003 to 2007
    By doddiah in forum Forms
    Replies: 3
    Last Post: 07-18-2015, 03:52 AM
  3. Modify Workgroup in Acess 2007
    By rpc86 in forum Security
    Replies: 2
    Last Post: 07-29-2014, 07:51 PM
  4. inserting into a SQL2005 db from Acess 2007 DB
    By macsterling in forum Queries
    Replies: 1
    Last Post: 11-28-2010, 09:12 AM
  5. Acess 2007 & SQL question
    By willigiann in forum Forms
    Replies: 3
    Last Post: 09-15-2010, 09:54 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