Automation Error with Access as Server

M

mbd-team

Hello,

i'm trying to use Access vom VB-6 as Automation Server. I want to use an
Access Form 'withevents'. Code is like:

dim withevents aForm as Access.Form


Sub test()
dim myAccess as new Access.Application

myAccess.OpenCurrentDatabase "test.mdb"
myAccess.DoCmd.OpenForm "MyForm"

set aForm=myAccess.Forms("MyForm")
....

Each Time the code is reaching the line set aForm=... I get an Automation
Error -2147220990. What is wrong with my code? I need to recognize the moment
the user is closing the form!
 

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