Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2003

Tip: Looking for answers? Try searching our database.

Abort Item_Save and Item_Close

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kristian - 13 Aug 2003 12:08 GMT
Hi,
If a custom field in a Contact form is empty I want to
-show a message and
-have the form stay open unsaved
Cancel=True in Item_Save doesn't seem to do the trick.

Any tip greatly appreciated!
Kristian
Sue Mosher [MVP] - 18 Aug 2003 22:37 GMT
The event handler is Item_Write. Use Item_Write = False.
Signature

Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
    Microsoft Outlook Programming: Jumpstart
    for Administrators, Power Users, and Developers
    http://www.slipstick.com/books/jumpstart.htm 

> Hi,
> If a custom field in a Contact form is empty I want to
[quoted text clipped - 4 lines]
> Any tip greatly appreciated!
> Kristian
Pbeast - 25 Aug 2003 16:14 GMT
THE ITEM_WRITE() IS FIRED WHEN A USER SAVES THE FORM. USE
THE FOLLOWING CODE TO MODIFY ITS EXECUTION. REPLACE THE
PROPER PAGES AND FIELDS WHERE NECESSARY.

Function Item_Write()

If Item.GetInspector.ModifiedFormPages("YOUR
PAGE").Controls("LAST_NAME").Value = ""  Then

MsgBox "Nothing was Saved Because Required Fields were
Incomplete", _
vbCritical

Item_Write = False

Exit Function
End IF
End Function
>-----Original Message-----
>The event handler is Item_Write. Use Item_Write = False.
[quoted text clipped - 7 lines]
>> Kristian
>.
Sue Mosher [MVP] - 25 Aug 2003 17:29 GMT
Or, even easier, use the value of the property, not the control:

   If Item.LastName = "" Then
       Item_Write = False
   End If
Signature

Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
    Microsoft Outlook Programming: Jumpstart
    for Administrators, Power Users, and Developers
    http://www.slipstick.com/books/jumpstart.htm 

> THE ITEM_WRITE() IS FIRED WHEN A USER SAVES THE FORM. USE
> THE FOLLOWING CODE TO MODIFY ITS EXECUTION. REPLACE THE
[quoted text clipped - 28 lines]
> >> Kristian
> >.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.