on lost focus txtCity is flickering, txtState is flickering and program freeze's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Burtik
    New Member
    • Nov 2014
    • 1

    on lost focus txtCity is flickering, txtState is flickering and program freeze's

    Code:
    Private Sub txtCity_GotFocus()
       sForText = "txtCity"
    End Sub
    
    Private Sub txtCity_LostFocus()
             If txtCity = "" Then
      picMsgBox.Visible = True
          picMsgBox.Top = 600
         picMsgBox.Left = 1560
               txtMyMSG = ""
               txtMyMSG = "Please Enter A City Or Township!"
             Else
         txtState.SetFocus
         Exit Sub
             End If
         
                          txtCity.SetFocus
    Last edited by Rabbit; Nov 24 '14, 05:28 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    I think the problem you are having is that every time you lose the focus on your control you are telling it to set the focus back to that control and perform more actions. It appears to be getting caught in an endless loop.....

    Comment

    Working...