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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pick Up Form Closed

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Hello All,

Here is the scenario:

I have a pop-up form (located centrally in a General .dot)
This form facilitates a very simple, say "Additional Information" input area.
The idea is that when the end-user fills out the
textbox and press "Proceed", I set a Property Value which is accessible to my calling code, to pick up what the user
has typed in.

However... the user can press the "X" (close form) button at the top of the form, without doing anything.
I know the Terminate Event is triggered, but I can not quite decide how I can let my calling program know that the form was closed in the *incorrect* way and that it should maintain status.

Note that I am trying to minimise my calling VBA to think too much - I want most of the intelligent code encapsulated in my .dot

Any ideas?
Best Regards,
EvE
PS: I have several screens, like dropdown, date etc, the textbox is just the easiest example.
 
The following code place in your user form code module will disable closing the userform by clicking on "X".

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If Not CloseMode Then Cancel = True
End Sub

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top