?
Solved

Finding a form's parent

Posted on 1998-09-01
4
Medium Priority
?
137 Views
Last Modified: 2010-04-30
I have a form,VendorInformation, that can be shown from two other forms,Requisitions and Purchase Orders, and a menu option, Vendor Maintenance.  Before I show the VendorInformation form from either the Requisitions or the Purchase Orders form, I hide the calling form.  Before I unload the VendorInformation form, I want to show the Requisitons or the Purchase Orders form.

How do I determine which form, Requisitions or Purchase Orders, called the VendorInformation form?
0
Comment
Question by:baileys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:baileys
ID: 1432429
Edited text of question
0
 
LVL 4

Accepted Solution

by:
tomook earned 300 total points
ID: 1432430
The simplest method, which avoids API calls, is to add a property to VendorInformation which tells it which form called it. For example, insert the following in VendorInformation:

Private mCallingForm As String

Public Property Let CallingForm(Value As String)
  mCallingForm = Value
End Property

Public Property Get CallingForm() As String
  CallingForm = mCallingForm
End Property

When you are closing VendorInformation, merely check the value of mCallingForm to determine to which form you should return.

In each calling form (Purchase Orders, Requisitions), use this calling convention
  VendorInformation.CallingForm = "PurchaseOrders"
  VendorInformation.Show
Or:
  VendorInformation.CallingForm = "Requisitions"
  VendorInformation.Show

The first reference to any property of a form loads the form, but it will not be visible until the method Show is called. Please forgive any typos.
0
 

Author Comment

by:baileys
ID: 1432431
Thanks.  I am setting mCallingForm to the form instead of a string.
0
 
LVL 4

Expert Comment

by:tomook
ID: 1432432
Even better.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question