Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable the QueryUnload button

Graphical User Interface (GUI)

Disable the QueryUnload button

by  JESTAR  Posted    (Edited  )
That little X button at the top right corner off your form... let's disable it.

[color green]
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Cancel <> 1 Then
Cancel = -1
End If
End Sub
[/color]

Note: this won't make it disappear, but it will make it disabled.

Any code that is run through an Exit button can't be skipped by the user pressing the QueryUnload button. You must include another means of exiting the form if you choose to use this.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top