dim withevents causes automation errors

F

Fred

I'm using VBA in Access 2000 with an ActiveX components and want to
try to get rid of all the problems with the ActiveX wrapper they won't
fix. I want to get my Intellisense back, but at the same time keep my
events. If I use the "withevents" parameter I get an automation
error:

In the General section:

Option Compare Database
Public WithEvents etLine1 As etTT37.etLine 'dim my dynamically
created com

In Form_Load:

Set etLine1 = etLine0.Object 'point to same type com I dropped on
form


1. If I leave out the "withevents" everything works, but then I have
to use the original etLine0 component I put on the form in order to
use the "object" and "procedures" dropdowns to create the event
handlers (procedures), but reference everything else as the etLine1
component so I get my Intellisense back

2. But if I put the "withevents" in, now in the object pulldown I have
events for my new component that I need. But trying to run the
program gives an automation error on the "set" line. Thanks.

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top