Make popup form close when user clicks outside of it


/ Published in: Visual Basic
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ' Change Timer value from default of 0 to something like 200
  2.  
  3. Private Sub Form_Timer()
  4. ' error trap is used to process situations when a form is clicked outside of the popup form
  5. On Error GoTo NotForm:
  6.  
  7. If Me.Name = Screen.ActiveForm.Name Then Exit Sub
  8.  
  9. NotForm:
  10. DoCmd.Close acForm, Me.Name, acSaveNo
  11. End Sub

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.