Microsoft KB Archive/190190

= OFF98: Program Quits Unexpectedly Using Unload with Enter Event =

Article ID: 190190

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh
 * Microsoft PowerPoint 98 for Macintosh
 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q190190



SYMPTOMS
When you display a user form in a Microsoft Office 98 Macintosh Edition program, the program may quit unexpectedly.



CAUSE
This problem may occur when all of the following conditions are true:
 * You create a control on the user form and attach code to the Enter event. -and-


 * The code that is attached to the Enter event for the control uses the Unload statement. -and-


 * The control has a TabIndex property of 0 (zero).



WORKAROUND
If you must use the Unload statement in the code that is attached to the Enter event for a control, set the TabIndex property to a value other than zero.

To change the TabIndex property for a control, follow these steps:
 * 1) Select the control on the user form.
 * 2) If the Properties window is not visible, click Properties Window on the View menu.
 * 3) In the Properties window, scroll until you see the TabIndex property and type a number other than zero for the property.

NOTE: This method renumbers the TabIndex property for all the controls on the user form. Check this property for all the other controls to see if they are in the correct order.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Because the Enter event occurs before the focus is moved to another control, you can use the Enter event to display instructions. For example, you can use a macro or event procedure to display a small form or message box that identifies the type of data the control contains.

