HOW: Skipping 'Do you want to save changes' when form is closed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a custom contact form in which I create some custom controls at load time. When the user closes the form, I do not want the dialog that comes up saying 'Do you want to save changes' to come up. Is there a way to skip around this in the code behind code? If the user clicks the 'Save and Close' button, I will save the data changes, but want the actual form changes (i.e. my dynamic controls) to be ignored and not saved.

Any help would be greatly appreciated

Thanks.
 
You could set Item.Close olDiscard '1 in the Item_Close event and set
Item_Write = False if that's called if you don't want to save the
item.




BG said:
I have a custom contact form in which I create some custom controls
at load time. When the user closes the form, I do not want the dialog
that comes up saying 'Do you want to save changes' to come up. Is
there a way to skip around this in the code behind code? If the user
clicks the 'Save and Close' button, I will save the data changes, but
want the actual form changes (i.e. my dynamic controls) to be ignored
and not saved.
 
Basically, I want to save data changes, but not changes made to the form itself. Is that even possible

----- Ken Slovak - [MVP - Outlook] wrote: ----

You could set Item.Close olDiscard '1 in the Item_Close event and se
Item_Write = False if that's called if you don't want to save th
item

-
Ken Slova
[MVP - Outlook
http://www.slovaktech.co
Author: Absolute Beginners Guide to Microsoft Office Outlook 200
Reminder Manager, Extended Reminders, Attachment Option
http://www.slovaktech.com/products.ht


BG said:
I have a custom contact form in which I create some custom control
at load time. When the user closes the form, I do not want the dialo
that comes up saying 'Do you want to save changes' to come up. I
there a way to skip around this in the code behind code? If the use
clicks the 'Save and Close' button, I will save the data changes, bu
want the actual form changes (i.e. my dynamic controls) to be ignore
and not saved
 
Changes made in controls in a form are never persistent unless the
control values are bound to user properties or built-in properties. To
save any changes you can call the Item.Save method. If you save the
item then all the data that is in bound controls will be saved in the
bound properties.




BG said:
Basically, I want to save data changes, but not changes made to the
form itself. Is that even possible?
 
Back
Top