Results 1 to 9 of 9

Textbox exit event is not working properly

Threaded View

  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

    Private Sub TextBox13_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Dim Response As VbMsgBoxResult
    Dim IsOk As Boolean
       IsOk = True
    If Me.TextBox13.Value = "" Or Me.TextBox13.Value = 0 Then
       MsgBox "Date is mandatory field please enter date", Title:="Date of Enrollement"
        If Response = vbOK Then Me.TextBox13.SetFocus
        Cancel = True
    End If
    
    End Sub
    Attached Files Attached Files
    Last edited by chavanalini; 03-26-2021 at 07:08 AM. Reason: adding tags

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. Exit Event with a single textbox control
    By ChazE911@gmail.com 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