General discussion

Locked

Access 97 OLE error

By learneverything ·
I created a macro to change the formatting of controls in 2 forms on enter and exit. It seemed to be working fine as I went back and forth between design and form view. But, when I closed the forms and tried to open either of them from the database window, I get the following error message.

"The object you referenced in the Visual Basic procidure as an OLE object isn't an OLE object." When I click OK, I see the following: "Action Failed
Macro Name Macro1.OnEnter
Condition True
Action Name Set Value
Arguments [Screen].[ActiveControl].[BoarderColor], 8388863

I click Halt, the form opens without the first control having the formatting, but when you tab to the next one, all is OK. You can even go back to the first control and it formats accordingly. Why would this happen from the database window, but not when coming from design view?

I'm open to suggestions for fixing. I'm going to experiement to see if the problem is some controls in the form that are unbound.Thanks.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 OLE error

by shmaltz In reply to Access 97 OLE error

The reason why this happens is because you are trying to change the fomatting of a control that does not exist. A control does not exist until the parent form has finished loading. To work around this I whould try moving the code to the Onactivate event or the oncurrent event, or on the gofocus event.

Collapse -

Access 97 OLE error

by learneverything In reply to Access 97 OLE error

Bless you, it worked.

Collapse -

Access 97 OLE error

by learneverything In reply to Access 97 OLE error

This question was closed by the author

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums