Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change #Error to 0 ?? (Access 2000 SR-1 / WinXP)

    Hello!
    Maybe this should be in the VBA area instead, but...I have a form, and on my form is a control that adds summed columns in two subforms. If there isn't anything in one fo the subforms, I get #Error. Is there some snippet of code I can write to change the #Error to a zero? (Zero is how much I know about VBA, in case you didn't figure that out already...I have fiddled around a bit and have something like If IsError(Text19)=True Then but that's all she wrote, and I don't even know where on the Event tab of the Properties it should be...if it should be there....etc)

    Many thanks for any suggestions!

    Regards,
    Mary Brodd

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Change #Error to 0 ?? (Access 2000 SR-1 / WinXP)

    Nope, this is the place for Access questions, whether they involve VBA or not.

    What you need in your formula is the Nz() function, something like this:

    =Nz(Me!Subform1!Total, 0) + Nz(Me!Subform2!Total,0)

    I'm assuming your subforms are named Subform1 and Subform2 for these purposes, and that you have a control called Total on each of them.

    However, you may still have a problem if there are not any *records* in the subform.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change #Error to 0 ?? (Access 2000 SR-1 / WinXP)

    Charlotte>However, you may still have a problem if there are not any *records* in the subform.

    yes, that's my problem. it's a work order thingie, hours and inventory, and the project can be entered before any work is done on it, so it's possible that one or both of the subforms might be empty at any given time. Where there IS information in both subforms, the formula I have already in place works peachily:

    =[frmHoursSummarySubform].Form!TotalLabor+[frmInvSummarySubform].Form!InvTotal

    I just don't want to look at #Errors all the time for new projects. Thanks very much for your help!

    Regards,
    Mary Brodd

  4. #4
    New Lounger
    Join Date
    Nov 2001
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change #Error to 0 ?? (Access 2000 SR-1 / WinXP)

    I'm sorry, I realize now I should have given more detail in my first message.
    Thank you for your help!

    Regards.
    Mary Brodd

Posting Permissions

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