+ Reply to Thread
Results 1 to 4 of 4

Text Box Calculation Default Value Even if No Records Exists

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    Ocean Isle Beach, NC
    MS-Off Ver
    2010
    Posts
    54

    Text Box Calculation Default Value Even if No Records Exists

    Hello all,

    I'm in desperate need. I have a form with two subforms (Material and Hardware). The Material and Hardware subforms both have an unbound text box in the form footer with a default value of 0 that calculates all of the POAmounts. I then use those values in another text box calculation on the main form. However, when there are no records in the Material or Hardware subforms, the default value of 0 doesn't display and this results in an error on my main form.

    How can I get the Material and Hardware subform total text boxes to always display a 0, even if there are no records in the subform?

    Any help is greatly appreciated.

    Margaret

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Text Box Calculation Default Value Even if No Records Exists

    Hi there,

    It's difficult to be precise about this without access to your UserForm(s), but one solution might be to check the value of the unbound TextBox immediately before the UserForm is closed (e.g. via an OK button) and to have your code insert a value of zero if the TextBox is empty.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    04-29-2016
    Location
    Ocean Isle Beach, NC
    MS-Off Ver
    2010
    Posts
    54

    Re: Text Box Calculation Default Value Even if No Records Exists

    Greg,

    Thanks for taking the time to help me. After many hours of research, I ended up adding =IIf(IsError in their to the text box calculations on the main form. It was a bear.

    Margaret

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Text Box Calculation Default Value Even if No Records Exists

    Hi again Margaret,

    Thanks for the feedback - glad to hear you've got things sorted out at this stage.

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 10-14-2015, 06:13 PM
  2. Default Dropdown menu to isolate records
    By johnandrews in forum Excel General
    Replies: 11
    Last Post: 12-17-2013, 06:12 PM
  3. How to change the default calculation in a Pivot Table?
    By GIS2013 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-07-2013, 09:44 AM
  4. force excel default settings to manual calculation mode
    By thosecars82 in forum Excel General
    Replies: 4
    Last Post: 12-27-2012, 07:34 AM
  5. Replies: 13
    Last Post: 01-24-2012, 09:38 AM
  6. How to add a default value (if less than function) to a calculation
    By dbaseguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2009, 11:41 AM
  7. [SOLVED] default manual calculation instead of auto in options excel 2003
    By Lost in Excel in forum Excel General
    Replies: 1
    Last Post: 10-09-2005, 02:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1