+ Reply to Thread
Results 1 to 12 of 12

clear userform does not clear all boxes

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Post clear userform does not clear all boxes

    hi
    my userform1 is nearly up and running have put a reset button on to clear all textboxes apart from overtime total
    have used
    [txtbox1=""] ect to clear others but this one is stubborn and i can not use this any ideas please
    Attached Files Attached Files
    Last edited by cfinch100; 01-23-2013 at 11:31 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: clear userform does not clear all boxes

    Which textbox isn't cleared?

    Have you checked all the control names?

    Why not use code similar that in ClearControls from the other form (frmMFRSA) to clear the controls?

    All you would need to add would be something to prevent the overtime total being cleared.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear userform does not clear all boxes

    hi
    its overtime total that will not cancel, have copied and pasted name so should be right ,will prob try clearcontrols and thought of another not sure if it will work but will try later [userform1 unload me then userform1.show again it should set it back to empty again do you think
    cheers colin

  4. #4
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear userform does not clear all boxes

    hi norie
    [unload me then userform1.show]
    this works for me not sure if it the right way though or just a short cut, the lazy way
    many thanks for response
    cheers colin

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: clear userform does not clear all boxes

    Colin

    There's nothing wrong with that method, as it works.

    Some people do kind of complain about a 'flicker' but it's never bothered me.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: clear userform does not clear all boxes

    Hi Colin...give me a bit...I see what's happening (I think).
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: clear userform does not clear all boxes

    Colin

    Just had another look - you aren't clearing any of the overtime total textboxes in the code.

    Those textboxes are called txtMoOTTotal, txtTuOTTotal etc.

    This will clear them.
    Please Login or Register  to view this content.
    You'll also need to change some code to avoid errors.
    Please Login or Register  to view this content.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: clear userform does not clear all boxes

    @Norie

    Yes, right on...I would have used a Boolean
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    but whatever turns your crank.

  9. #9
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear userform does not clear all boxes

    hi
    i tried[txtMoOTTotal = ""] copied and pasted was not having any of it, all other boxes worked using this method, and yes was getting an error mainly when textbox13 (setp price) was empty ie no cost,so i changed prices to £0 and that seemed to work,have not proof tested yet but will morrow.

    i will do the code changes as you suggested also
    many thanks to you both for your ongoing help its much appreciated and needed
    cheers colin

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: clear userform does not clear all boxes

    Hi Colin
    The Code in the attached does, based on what I understand, what you wish to do. Let me know of issues.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear userform does not clear all boxes

    hi
    just gone through it all very good thankyou , few tweeks reqd couple of boxes needed clearing of data , thankyou for help given , well pleased
    cheers colin

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: clear userform does not clear all boxes

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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