BUG: Access 97 Generates Invalid Code for OLE_COLOR in Event Handler

ID: Q205673


The information in this article applies to:
  • Microsoft Access 97


SYMPTOMS

When handling an event for an ActiveX control in an Access 97 form, you may run into problems if any of the events use OLE_COLOR for a parameter. Specifically, you may get a message that states the following:

The expression "somename" you entered as the event property setting produced the following error: Function or interface marked as restricted or the function uses an automation type not supported in Visual Basic

*The expression may not result in the name of a macro, the name of a user defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.


CAUSE

This is due to a limitation in the Access 97 product.


RESOLUTION

If you have the source code for the control, you need to change the parameter that is using OLE_COLOR to a different type like a long. Otherwise, you will not be able to catch the event of the control in Access 97.


STATUS

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


MORE INFORMATION

Steps to Reproduce Behavior

  1. Insert a control into an Access 97 form that has an event with an OLE_COLOR parameter.


  2. Double-click the control on the form in design view.


  3. Change to the event that uses the OLE_COLOR.


You will notice that the event handler has the incorrect parameter type. Access 97 generates code that looks something like this:

Private Sub ActiveXCtl0_Test(testparam As 0)
End Sub 

Additional query words: kbDSupport Access97Bug MFC Control Container Limitations

Keywords : kbole kbActiveX kbAutomation kbMFC kbVC kbDSupport
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: July 30, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.