+ Reply to Thread
Results 1 to 5 of 5

Cancel button on form deletes text and needs clicking twice

  1. #1
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473

    Cancel button on form deletes text and needs clicking twice

    Hi all,

    I have a userform in my project with a MultiLine TextBox and cancel button (Cancel property set to True). When clicking this button I have this code:

    Please Login or Register  to view this content.
    I have several projects with the same functionality but on this one, when I click the Cancel button it clears all the text that is in the text box (on the first click) and when I click cancel again it actually unloads the form.

    Has anyone seen this before and can help?

    Thanks
    John

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Cancel button on form deletes text and needs clicking twice

    I can't see why that code doesn't just close the form
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473

    Re: Cancel button on form deletes text and needs clicking twice

    no me neither, should be simple. Ive attached a copy of the sheet (It is just a test sheet I am making to allow people to add comments to protected cells...)
    Attached Files Attached Files

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Cancel button on form deletes text and needs clicking twice

    What do you think this code does ??

    Please Login or Register  to view this content.
    I 'd prefer:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by snb; 11-19-2010 at 10:32 AM.



  5. #5
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473

    Re: Cancel button on form deletes text and needs clicking twice

    ahh yes, I see where I've gone wrong. Loading the frmComments twice - what did I expect to happen!?!

    thanks very much for pointing that out and for the tidier coding, much appreciated.

    John

+ 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