Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Oct 2016
    Thanked 0 Times in 0 Posts

    Access textbox clearing out issue

    I have a form with a bunch of fields to do simple calculations where a user will enter in a number into a text box and then then another textbox will enter in a percent and the percentage of the first amount will return to the screen (so field one says 1000 and field 2 is 50% then it will return 500 to the screen). The fields that they enter into are unbound textboxes and I have a clear button on the screen that will wipe those amounts away by doing a text1.value = "".
    However, I have a field that is doing a calculation where it is returning #Type! back to the screen when I open the form, where all the other fields are blank upon opening.
    I can't get this field to be blank upon opening. Can someone help me to get this field to clear out when the clear button is pushed and to be blank when the form is opened?

    This is what is in the control source of this textbox:

    which will show 100 in the field as opposed to #Type!

    I have also tried this:

    which returns the #Type!

    Any help is appreciated, thanks

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 40 Times in 39 Posts
    The IIF statement evaluates both "sides"; that is, even if the condition is met, the other condition is also evaluated. So in your example, if Text40 is Null, then Val(text40) will fail. You might try Val(text40 + "").
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Tags for this Thread

Posting Permissions

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