Changing Close Button function "X"

How do i change the close button function from

ending the program to changing the window state to minimize
Who is Participating?
appariConnect With a Mentor Commented:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

If UnloadMode = 0 Then
    Cancel = True
    Me.WindowState = vbMinimized
End If
End Sub
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.