+ Reply to Thread
Results 1 to 9 of 9

Textbox exit event is not working properly

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Textbox exit event is not working properly

    Hi,

    In my userform, I have a textbox to enter date, I wanted to make this textbox as a mandatory field, if user tries to leave the textbox blank or not entered any date and they were trying to move next textbox it has to show error "Date is mandatory field please enter date".

    I used below code but it is not working. Can anyone help me to do this please

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by chavanalini; 03-26-2021 at 07:08 AM. Reason: adding tags

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Textbox exit event is not working properly

    You're not actually setting the Response variable.

    You'd need
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Textbox exit event is not working properly

    Thanks for your quick reply.

    I tried with your suggestion but still it is not working, when I press tab without entering any value it is not showing any message and the focus is moving to the next text box.

    Thank you

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Textbox exit event is not working properly

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)



    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Textbox exit event is not working properly

    Thanks for your suggestion. I have added the tags to the code.

  6. #6
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Textbox exit event is not working properly

    Hi,

    Can anyone help me with the issue which I have posted

    Thanks

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Textbox exit event is not working properly

    I suggested you upload a sample file. How can we assess what is happening without it?

  8. #8
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Textbox exit event is not working properly

    Hi, I have uploaded the file which I am working. I am facing 2 issues with the application

    1. In "Date of Enrollment" textbox I have written code if anyone trying to leave blank that textbox it needs to show msg "Please enter Date of enrollment". I have written this code in Textbox Exit event which not working.

    2. After completion of data entry if I close the form it is showing message boxes which I have given for validation. I didn't understand why I am getting message box after closing the form.

    Please help me with these 2 issues that would be great. I tried different ways but no luck, that is the reason I am posting in this forum to take help from the experts.

    Thank you so much

  9. #9
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Textbox exit event is not working properly

    Hi, Can anyone help me with the issues which I have posted

    Thanks

+ 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. Textbox exit event prevents to exit userform
    By smjjvh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2014, 06:08 AM
  2. [SOLVED] Problems with Exit event for Textbox
    By tfurnivall in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2013, 11:03 AM
  3. Textbox Exit Event Cant not be trigger
    By stewegg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2012, 01:26 PM
  4. Userform Textbox Exit Event to Run Application
    By baisty182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2010, 12:30 PM
  5. Userform textbox event that fires after I exit the textbox
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-04-2010, 08:08 AM
  6. Exit Sub Property is not working Properly!!
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2009, 06:55 AM
  7. [SOLVED] Exit Event with a single textbox control
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2006, 09:55 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