Open and close a second instance of a form?

C

CW

I have a Suppliers table and corresponding form on which we hold all the
details of the companies that supply us with materials.
Some of these have head offices and branch offices, whose details we need to
access from time to time. So those other companies have been added to the
Suppliers table.
I created a field and control named Suppliers.LinkedCompany. The control is
a combo so that users can look up and select the relevant record.
Then I coded the double-click event on the combo control so that users could
hop into any supplier's linked company and that's fine, it opens the
Supplier's form for that organisation. All good so far.
However, upon closing the form it shuts down not only the record for the
linked company but the original Supplier record as well. We would like to be
able to return to the original record after the visit to the linked company
is over.
I hope I have explained this clearly enough for somebody to give me advice!
Many thanks
CW
 
A

Allen Browne

As you found, you can use the New keyword to open another instance of the
same form, but managing the independly of each other takes a little more
effort.

See:
Managing Multiple Instances of a Form
at:
http://allenbrowne.com/ser-35.html

The article explains how to use a collection based on the hWnd of the
instance to manage them.
 
C

CW

Allen -
Thanks a lot. I'll need to study that a couple of times (at least!) but it
certainly looks like just what I needed.
Much appreciated
CW
 

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