VBA - Forms Exit Errors

  • Thread starter Thread starter jordanctc
  • Start date Start date
J

jordanctc

I made a real whizbang form with a lot of enabling and disabling wit
shifting focus based on user input.

The problem is the setfocus in the form blows up when the user hit th
X to exit out of the window.

Is there a way to disable the X and just make them finish the form?

I like having forms that take the errors out and save steps by shiftin
focus - I'd _really_ hate to lose all of that. So any answers o
advise??

Thanks,
Jorda
 
jordanctc

This should prevent the user fron using the "X".



Private Sub userform_QueryClose(Cancel As Integer, CloseMode A
Integer)
Application.ScreenUpdating = False
If CloseMode = vbFormControlMenu Then
MsgBox "You Have to use the Exit Button to close!"
Cancel = True
End If
End Sub


HTH

Charle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top