Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106

    Unanswered: Getting a #Num! printed on a MS access report

    Hi,
    I have a field on a MS Access 2003 report that is printing the output of this formula: [Curr_Vis_Out]/([Curr_Vis_Out]+[Curr_Vis_In], but in some rows it prints #Num!. I think this is resulting from the fact that I am dividing by zero. I used the NZ function but it is still not fixed.

    The new code is:
    Nz([Curr_Vis_Out]/([Curr_Vis_Out]+[Curr_Vis_In]),0) but it did not work.

    Please help.
    Thanks
    Mo

  2. #2
    Join Date
    May 2009
    Posts
    258
    Yeah, you may be getting a divide-by-zero error. Try using the following instead:
    Code:
    [Curr_Vis_Out] / IIf([Curr_Vis_Out] + [Curr_Vis_In] = 0, 1, [Curr_Vis_Out] + [Curr_Vis_In])
    Ax

  3. #3
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Try putting Nz around your fields as below:

    Nz([Curr_Vis_Out])/Nz([Curr_Vis_Out])+Nz([Curr_Vis_In])
    Regards
    JD

    Software-Matters

  4. #4
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106
    Ax238's suggestion worked great.
    Thanks
    Mo

  5. #5
    Join Date
    May 2009
    Posts
    258
    Great to hear, glad I could help.

Posting Permissions

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