+ Reply to Thread
Results 1 to 7 of 7

Unable to Execute Reset Userform...Runtime Error :-(

  1. #1
    Registered User
    Join Date
    05-21-2020
    Location
    Manila, Philippines
    MS-Off Ver
    Office 365
    Posts
    25

    Unable to Execute Reset Userform...Runtime Error :-(

    Hi,

    I have created this userform with a database in excel and I am facing some coding problems.

    I was able to have every attribute working with a percentage of score being displayed as you go along the each attribute in the form. I am able to save it, but when I try to do the command button "Reset", then it gives me an error. Run-time error "6' Overflow.

    and it refers me to this string of commands Entry_Form.Score_Achieved.Value = Format(score/weight, "#%")

    Can someone please help me out? Been trying to google some resolution myself and couldn't find one.

    Attached is a sample of the sheet.

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    I will look at your file but the first thing I would check is see if weight is 0 when this happens.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-21-2020
    Location
    Manila, Philippines
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    Thank you so much.

    If I do Entry_Form.Scored_Achieved.Value = Cstr(score) & " /" & Cstr(weight), it works. I am able to execute the reset command. But i needed to show the percentage as the actual score, so when I changed the formula the one mentioned on the orginal post, the error occurs.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    When you clear out your form, you are blanking out all the combo boxes. Each time you do this, you trigger the Change event, which calls Add_Scores. When weight is zero (because you blank it out, too), you get a divide-by-zero overflow.

    You should not even be calling Add_Scores when you reset the form. You should have a global Boolean variable in your form, called something like Resetting. You set it to TRUE at the beginning of cmd_Reset_Click. Then in your combobox Change handlers, make the first line of code

    Please Login or Register  to view this content.
    Two other suggestions, from a user interface design standpoint. You have a lot of choices that are all Yes/No/NA. The user has to click twice on each one to select it, once to select it, and then to make a choice. And there are a lot of them. You can save the user a lot of time and frustration by using option buttons instead (one click each).

    Second, rather than validating the input after the user clicks Save, keep the Save button disabled until the user has filled in all required data. The way it is now, if the user makes multiple mistakes, the code only tells him one at a time. I had to click Save several times to test your file.

  5. #5
    Registered User
    Join Date
    05-21-2020
    Location
    Manila, Philippines
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    Sorry about that, I am really new to this and that is why most of my codes are long ones. I am still learning what the new shortcuts for these are. I actually studied this lesson in youtube but it used the long method of coding. I am really not familiar how to form a formula for that Reset, I just did recycled some from my old forms. I did some googling for the scores and just learned how to add it out to my existing one.

  6. #6
    Registered User
    Join Date
    05-21-2020
    Location
    Manila, Philippines
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    The interface I can definitely modify that, it was just what my manager wanted to see. But I can definitely improve and propose it to her. I already got an idea on how to do that enable.disable Save button for the validation.

    So I am now down to that Overflow error message still, will you be able to assist me in how to solve that problem? You may start the code and I can try to learn it and use it on the others.

    Thank you in advance sir.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Unable to Execute Reset Userform...Runtime Error :-(

    Attached is your file with the solution I suggested for Reset.
    Attached Files Attached Files

+ 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. Runtime Error 1004 : Unable to get the Match Property
    By agengler11 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2018, 11:59 AM
  2. [SOLVED] Reset form on no results found (Runtime error)
    By chrisandsally in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2015, 03:09 PM
  3. runtime error 1004 unable to get match property
    By AAvcal71 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2014, 03:10 PM
  4. Unable to resolve Runtime error 91
    By jr2007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2013, 07:37 AM
  5. [SOLVED] Runtime error...53; unable to debug
    By vinay.kottur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 01:34 PM
  6. [SOLVED] Runtime error 1004 Unable to set the name property of the font class
    By fairtradder1958 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2012, 04:18 PM
  7. Unable to execute sub procedure with 2 arguments (compile error)
    By ath1337 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-21-2011, 02:12 PM

Tags for this Thread

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