OFF98: Program Quits Unexpectedly Using Unload with Enter Event (190190)



The information in this article applies to:

  • Microsoft Excel 98 Macintosh Edition
  • Microsoft PowerPoint 98 Macintosh Edition
  • Microsoft Word 98 Macintosh Edition

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.

REFERENCES

For more information about the Enter event, from the Visual Basic Editor, click the Office Assistant, type enter event click Search, and then click to view "Enter, Exit Events."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

176476 OFF: Office Assistant Not Answering Visual Basic Questions


Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbbug kbnofix kbProgramming KB190190